Skip to main content

Bossa CLI Reference

The Bossa CLI manages accounts, workspaces, API keys, and provides full filesystem access. It is a first-class interface for agents — when your harness runs tools as subprocesses, use bossa files for the same operations as MCP. Install: pip install bossa-memory

Agent Documentation (bossa init)

Add Bossa usage instructions to your agent config files (AGENTS.md, CLAUDE.md, GEMINI.md) so your AI agent knows how to use Bossa.
Scans project and global locations for AGENTS.md, CLAUDE.md, and GEMINI.md, then appends a Bossa section. When multiple files are found, a checkbox list appears: use arrow keys to navigate, Space to toggle, Enter to confirm. In interactive mode, you are also asked how your agent will use Bossa (CLI, MCP, or both). Use flags for non-interactive use: Append (default): Adds the Bossa section to the end of the file. Asks for confirmation unless --yes. Overwrite: Use --overwrite to update an existing Bossa section. Use this when you upgrade to a new bossa version — the generated content includes version-specific commands and flags. Requires the flag explicitly.

Authentication

Credentials are stored in ~/.config/bossa/credentials (or $XDG_CONFIG_HOME/bossa/credentials).

Workspaces

Requires login (bossa login).

Upgrade to Pro

Requires login (bossa login).

Workspace Context (Active Workspace)

Set an active workspace to avoid passing --key on every bossa files command. Config is stored in ~/.config/bossa/config.json (or $XDG_CONFIG_HOME/bossa/config.json).

Usage

Displays a techy panel with progress bars, percentages, remaining counts, and reset info. Use --json or BOSSA_CLI_JSON=1 for machine-readable output with computed fields (pct_storage, remaining_storage_mb, reset_utc, etc.). Exit codes: 0 success, 1 error, 2 auth failure.

API Keys

Use --name with create to name the key (default: default).

Filesystem Commands

bossa files commands use API key from: --key > BOSSA_API_KEY > BOSSA_WORKSPACE (from config) > config.active_key. Run bossa workspace use <name> --key <key> to avoid passing --key on every command. Default API: BOSSA_API_URL.

Agent Mode

  • --json or -j — Output JSON for machine parsing
  • BOSSA_CLI_JSON=1 — All commands return JSON without passing the flag
  • --safe — On read-only commands (ls, read, grep, glob, stat, tree, du), signals auto-approval for agent harnesses that gate tool execution
  • Exit codes: 0 success, 1 error (not found, validation), 2 auth failure

ls — List directory

  • path (default: /): Directory to list
  • Output: One item per line; directories end with /
  • JSON (with --json or BOSSA_CLI_JSON=1): {"items": [{"name": "a/", "type": "directory"}, {"name": "b.txt", "type": "file", "size": 1024, "modified": "2026-03-06T10:00:00Z"}]}

read — Read file

  • path: File path
  • Output: Raw content to stdout (for piping)
  • JSON: {"path": "...", "content": "..."}

write — Write file

  • path: File path
  • —content, -c: Content string (or read from stdin)
  • Output: “Wrote /path” or {"path": "...", "wrote": true}

grep — Search contents

  • pattern: Literal or regex pattern (optional if using —all-of/—any-of/—none-of)
  • —path, -p (default: /): Scope to subtree
  • —regex: Treat pattern as regex
  • —case-sensitive: Case-sensitive match
  • —whole-word: Match whole words only
  • —output-mode, -o (default: matches): matches | files_with_matches | count
  • —max-matches (default: 100): Max results
  • —offset: Pagination offset
  • —all-of: All terms must match (AND). Repeatable.
  • —any-of: At least one term must match (OR). Repeatable.
  • —none-of: Exclude lines matching any. Repeatable.
  • —context-before: Lines before each match
  • —context-after: Lines after each match

glob — Find by pattern

  • pattern: Glob (e.g. *.md, **/*.py)
  • —path, -p (default: /): Scope to subtree
  • Output: One path per line
  • JSON: {"paths": ["/a.md", "/b.md"]}

edit — Replace substring

  • path: File path
  • —old, -o: String to replace
  • —new, -n: Replacement string
  • —all, -a: Replace all occurrences (default: first only)

stat — File metadata

  • path: File path
  • Output: size, modified, created
  • JSON: {"path": "...", "size": N, "modified": "...", "created": "..."}

tree — Directory tree

  • path (default: /): Directory to show
  • —depth, -d: Max depth (default: unlimited)

du — Disk usage

  • path (default: /): Directory to summarize
  • Output: Size per directory

delete — Delete file

put — Upload single file

  • local_file: Local file path
  • —target, -t: Remote path (default: / + basename)

batch — Batch operations

Reads JSON lines from stdin. Each line: {"op": "read"|"write"|"delete", "path": "...", "content": "..."} (content required for write). Max 100 ops.

upload — Bulk upload

  • local_path: Directory or file
  • —target, -t: Remote path prefix
  • —include-hidden: Include hidden files (. prefix)

Environment Variables

Self-hosting: Set SUPABASE_URL and SUPABASE_ANON_KEY when using a self-hosted backend.

CLI vs MCP

Both expose the same filesystem operations. See Agent Integration for examples.
Last modified on March 13, 2026