CLI Reference
A command-line interface for managing Stash from your terminal — push history events and manage all resources.
--json for machine-readable output and --ws ID to target a specific workspace.Install
pip install stashaiFirst-time setup
Run the interactive setup wizard. It configures the API endpoint, authenticates you (login or register), and creates a workspace — all in one shot. No manual config editing required.
stash connectThe wizard saves everything to ~/.stash/config.json. Once complete, commands like stash history push work without extra flags.
Authentication
stash login<name> --password <pw>Authenticate with username and password.
<name>stringREQUIREDYour username.
--passwordstringREQUIREDYour password.
stash signin[--api URL] [--no-browser] [--timeout N]Open the browser for OAuth sign-in. Blocks until the user authorizes. Writes credentials on success and auto-selects the default workspace if there is exactly one.
--apistringStash API base URL. Override for self-hosted deployments. Defaults to https://api.stash.ac.
--pagestringSign-in page URL. Defaults to the /connect-token page matching --api.
--no-browserflagSkip auto-opening the browser; just print the URL. Use on SSH or headless machines.
--timeoutnumberSeconds to wait for sign-in. Defaults to 120.
stash register<name> [--password <pw>]Create a new Stash account and store the API key.
<name>stringREQUIREDUsername for the new account.
--passwordstringPassword for the account.
stash auth<base_url> --api-key <key>Store existing credentials for a Stash instance.
<base_url>stringREQUIREDBase URL of the Stash server.
--api-keystringREQUIREDYour API key.
stash whoamiDisplay the currently authenticated user.
stash disconnectSign out and clear all stored credentials so the next stash connect re-onboards.
stash config[key] [value] [--project]View or update a configuration value. Keys: base_url, default_workspace, output_format. Run without arguments to show all config.
keystringConfig key to read or write.
valuestringNew value. Omit to read the current value.
--projectflagWrite to project-level config (.stash/config.json in the repo) instead of user config.
stash connect, your defaults are stored. You can still override any value: e.g. stash config base_url https://joinstash.ai or set STASH_API_KEY / STASH_URL as environment variables for CI and scripts.Workspaces
stash workspaces list[--mine]List workspaces you belong to.
--mineflagShow only workspaces you own.
stash workspaces create<name> [--description TEXT] [--public]Create a new workspace.
<name>stringREQUIREDName for the workspace.
--descriptionstringWorkspace description.
--publicflagMake the workspace publicly visible.
stash workspaces join<invite_code>Join a workspace by invite code.
<invite_code>stringREQUIREDInvite code or magic link token.
stash workspaces use<workspace> [--scope user|project]Set the default workspace for future commands. Accepts a workspace ID or name.
<workspace>stringREQUIREDWorkspace ID or name to set as default.
--scopestringWhere to write config: "user" or "project". Defaults to "user".
stash workspaces info<workspace_id>Show workspace details.
<workspace_id>stringREQUIREDID of the workspace.
stash workspaces members<workspace_id>List members of a workspace.
<workspace_id>stringREQUIREDID of the workspace.
Notebooks
stash notebooks list[--ws ID] [--all]List notebooks in the current workspace.
--wsstringWorkspace ID override.
--allflagInclude notebooks from all workspaces.
stash notebooks create<name> [--ws ID] [--personal]Create a new notebook collection.
<name>stringREQUIREDName for the notebook.
--wsstringWorkspace ID override.
--personalflagCreate as a personal notebook.
stash notebooks pages<notebook_id> [--ws ID]List all pages in a notebook.
<notebook_id>stringREQUIREDID of the notebook.
--wsstringWorkspace ID override.
stash notebooks add-page<notebook_id> <name> [--content '...']Add a new page to a notebook.
<notebook_id>stringREQUIREDID of the notebook.
<name>stringREQUIREDPage title.
--contentstringInitial page content.
stash notebooks read-page<notebook_id> <page_id>Read the content of a notebook page.
<notebook_id>stringREQUIREDID of the notebook.
<page_id>stringREQUIREDID of the page.
stash notebooks edit-page<notebook_id> <page_id> --content '...'Update the content of a notebook page. Reads from stdin if --content is not given.
<notebook_id>stringREQUIREDID of the notebook.
<page_id>stringREQUIREDID of the page.
--contentstringNew page content. Reads from stdin if omitted.
History
stash history push<content> [--agent cli] [--type message] [--session ID] [--attach FILE]Push a new event to the workspace history stream.
<content>stringREQUIREDEvent content to push.
--wsstringWorkspace ID override.
--agentstringAgent identifier. Defaults to "cli".
--typestringEvent type. Defaults to "message".
--sessionstringSession ID to group events under.
--toolstringTool identifier.
--attachpathLocal file path to upload and attach. Repeatable.
--attach-idstringPre-uploaded file ID to attach. Repeatable.
stash history query[--agent X] [--type Y] [-n 50] [--all]Query recent history events with optional filters.
--wsstringWorkspace ID override.
--agentstringFilter by agent identifier.
--typestringFilter by event type.
-n, --limitnumberMaximum number of results. Defaults to 50.
--allflagQuery across all workspaces.
stash history search<query> [--ws ID] [-n 50]Full-text search across workspace history.
<query>stringREQUIREDSearch query.
--wsstringWorkspace ID override.
-n, --limitnumberMaximum number of results. Defaults to 50.
stash history agents[--ws ID]List distinct agent names that have logged events in this workspace.
--wsstringWorkspace ID override.
stash history transcript<session_id> [--ws ID] [--save PATH]Fetch a full session transcript and print or save it. Transcripts are stored gzipped on the server and decompressed automatically.
<session_id>stringREQUIREDID of the session.
--wsstringWorkspace ID override.
--savepathSave the transcript to a file instead of printing.
Tables
stash tables list[--ws ID] [--all] [--personal]List tables in the current workspace.
--wsstringWorkspace ID override.
--allflagInclude tables from all workspaces.
--personalflagShow only personal tables.
stash tables create<name> [--ws ID] [--columns JSON]Create a new table with optional column definitions.
<name>stringREQUIREDName for the table.
--wsstringWorkspace ID override.
--columnsJSONColumn definitions as a JSON array of {name, type, options?}.
stash tables update<table_id> [--name TEXT] [--description TEXT]Update a table's name or description.
<table_id>stringREQUIREDID of the table.
--wsstringWorkspace ID override.
--namestringNew table name.
--descriptionstringNew table description.
stash tables schema<table_id>Show a table's column schema.
<table_id>stringREQUIREDID of the table.
--wsstringWorkspace ID override.
stash tables rows<table_id> [--sort COL] [--filter COL]Fetch rows from a table. Sort and filter accept column names, which are auto-resolved.
<table_id>stringREQUIREDID of the table.
--sortstringColumn name to sort by.
--filterstringColumn name to filter on.
--wsstringWorkspace ID override.
stash tables insert<table_id> <data_json>Insert a new row. Data is a JSON object with column names as keys.
<table_id>stringREQUIREDID of the table.
<data_json>JSONREQUIREDRow data as a JSON object.
--wsstringWorkspace ID override.
stash tables import<table_id> <file> [--format csv|json]Bulk import rows from a file. Auto-chunks into batches of 5000. CSV uses the first row as column headers. Supports piping: cat data.csv | stash tables import <id> --format csv.
<table_id>stringREQUIREDID of the table.
<file>pathREQUIREDPath to the import file.
--formatstringFile format: "csv" or "json". Auto-detected if omitted.
stash tables update-row<table_id> <row_id> <data_json>Update an existing row with a partial merge. Data is a JSON object with column names as keys.
<table_id>stringREQUIREDID of the table.
<row_id>stringREQUIREDID of the row to update.
<data_json>JSONREQUIREDUpdated row data as a JSON object.
--wsstringWorkspace ID override.
stash tables delete-row<table_id> <row_id>Delete a row from a table.
<table_id>stringREQUIREDID of the table.
<row_id>stringREQUIREDID of the row to delete.
--wsstringWorkspace ID override.
stash tables add-column<table_id> <name> [--type text] [--options TEXT]Add a column to a table.
<table_id>stringREQUIREDID of the table.
<name>stringREQUIREDColumn name.
--typestringColumn type. Defaults to "text".
--optionsstringComma-separated options for select/multiselect columns.
--wsstringWorkspace ID override.
stash tables delete-column<table_id> <column_id>Delete a column from a table.
<table_id>stringREQUIREDID of the table.
<column_id>stringREQUIREDColumn ID (col_xxx) or column name.
--wsstringWorkspace ID override.
stash tables count<table_id>Count rows in a table, optionally with filters.
<table_id>stringREQUIREDID of the table.
--wsstringWorkspace ID override.
stash tables export<table_id>Export all rows from a table as CSV.
<table_id>stringREQUIREDID of the table.
--wsstringWorkspace ID override.
stash tables delete<table_id> [-y]Delete a table and all its data.
<table_id>stringREQUIREDID of the table.
-y, --yesflagSkip confirmation prompt.
--wsstringWorkspace ID override.
Files
stash files upload<path> [--ws ID]Upload a file to a workspace or to your personal files.
<path>pathREQUIREDPath to the file.
--wsstringWorkspace ID. Omit to upload as a personal file.
stash files list[--ws ID]List files in a workspace or your personal files.
--wsstringWorkspace ID. Omit to list personal files.
stash files rm<file_id>Delete a file.
<file_id>stringREQUIREDID of the file to delete.
stash files text<file_id>Print extracted text for a file (PDF, image OCR, or plain text).
<file_id>stringREQUIREDID of the file.
Invites
stash invite[--ws ID] [--uses N] [--days N]Create a magic-link invite — a single-use, TTL-bounded token for zero-friction workspace onboarding.
--wsstringWorkspace ID to create the invite for.
--usesnumberMaximum times the link can be redeemed. Defaults to 1.
--daysnumberDays until the link expires. Defaults to 7.
stash invite list[--ws ID]List active invite tokens for a workspace.
--wsstringWorkspace ID override.
stash invite revoke<token_id> [--ws ID]Revoke an invite token so it can no longer be redeemed.
<token_id>stringREQUIREDID of the invite token to revoke.
--wsstringWorkspace ID override.
Keys
stash keys listList your active API keys (one per device / login).
stash keys revoke<key_id>Revoke an API key by ID. Any device using it will receive a 401 on the next call.
<key_id>stringREQUIREDID of the key to revoke.
Streaming & hooks
Install Stash hooks for all supported coding agents on your $PATH, then enable or disable streaming per repo.
stash installInstall hook plugins for all supported coding agents on your PATH.
stash enableRe-enable activity streaming for the current repository.
stash disableStop streaming for this repo without touching the committed manifest.
stash settings[--json]Open the interactive settings page.
--jsonflagPrint a read-only snapshot of settings instead of opening the interactive page.