CLI Reference
The tango-sdk CLI is included in tango-api and provides build, development, and validation tools.
The scaffolder sets up npm scripts that invoke the CLI:
{ "scripts": { "dev": "bun node_modules/tango-api/src/cli.ts dev", "build": "bun node_modules/tango-api/src/cli.ts build", "sync": "bun node_modules/tango-api/src/cli.ts sync", "validate": "bun node_modules/tango-api/src/cli.ts validate", "publish": "bun node_modules/tango-api/src/cli.ts publish" }}If no project path argument is given, the current working directory is used.
Commands
Section titled “Commands”Builds the instrument’s frontend and backend (if present) using Bun’s bundler.
tango-sdk build# orbun run buildWhat it does:
- Reads the manifest from
package.json - Builds
src/index.tsx→dist/index.js(ESM, browser target) - If
backendEntrypointis set, buildssrc/backend.ts→dist/backend.js(ESM, bun target)
Output:
Build complete in 42ms — frontend: ok, backend: okExit code: 1 if either build fails.
Watches for changes and rebuilds automatically. Notifies the running Tango app to hot-reload.
tango-sdk dev# orbun run devWhat it does:
- Syncs dependencies (clears Bun cache and runs
bun installto refreshfile:deps) - Runs an initial build
- Watches
src/for file changes - Rebuilds on change
- Sends a reload signal to the Tango dev server
Use this during development for the fastest feedback loop.
Generates tango-env.d.ts with type declarations based on your instrument’s settings schema.
tango-sdk sync# orbun run syncWhat it does:
- Reads the
settingsarray from your manifest - Generates a TypeScript declaration file with typed setting keys
Output:
Generated tango-env.d.tsRun this after changing your settings schema to keep types in sync.
validate
Section titled “validate”Validates the instrument manifest and project structure.
tango-sdk validate# orbun run validateChecks performed:
| Check | Description |
|---|---|
id | Present and is a string |
name | Present and is a string |
entrypoint | Present, is a string, and source file exists |
panels | Present, at least one slot is true, no unknown slots, all booleans |
permissions | If present, all values are valid permission strings |
settings | If present, each has key, title, valid type; select type has options |
Output on success:
Validation passed.Output on failure:
Validation found 2 error(s): id: Missing or invalid 'id' (must be a string) panels: At least one panel slot must be trueExit code: 1 if any errors found.
publish
Section titled “publish”Publishes your instrument to the official Tango marketplace by creating a pull request.
tango-sdk publish# orbun run publishPrerequisites:
- GitHub CLI (
gh) installed and authenticated (gh auth login)
What it does:
- Validates your instrument manifest
- Forks the central marketplace repo (
MartinGonzalez/tango-instruments) - Copies your instrument source files into the fork
- Updates the marketplace index (
tango.json) - Creates a pull request for review
Excluded files (not copied to marketplace):
node_modules/, .git/, dist/, .claude/, .env, .DS_Store, bun.lock, bun.lockb
Output:
[publish] Checking prerequisites...[publish] Validating instrument...[publish] Instrument: My Instrument (my-instrument)[publish] Forking MartinGonzalez/tango-instruments...[publish] Cloning fork...[publish] Copying instrument files...[publish] Pushing to fork...
[publish] PR created: https://github.com/MartinGonzalez/tango-instruments/pull/42Updating an existing instrument: Run publish again — it force-pushes the branch and reports the existing PR URL.
Valid permissions
Section titled “Valid permissions”The validator accepts these 9 permission strings:
storage.filesstorage.dbstorage.propertiessessionsconnectors.readconnectors.credentials.readconnectors.connectstages.readstages.observe
Valid setting types
Section titled “Valid setting types”string— text input (optional:default,placeholder)number— numeric input (optional:default,min,max,step)boolean— toggle (optional:default)select— dropdown (required:optionsarray, optional:default)