# Available commands

Quick reference for `bitoarch` CLI commands used to configure and manage [**Bito's AI Architect**](/ai-architect/overview.md).

{% hint style="info" %}
**Note:** After [installation of AI Architect (self-hosted)](/ai-architect/installation/install-ai-architect-self-hosted.md), the `bitoarch` command is available globally. All commands support `--help` for per-command usage.
{% endhint %}

## Lifecycle

Commands used to control the lifecycle of AI Architect.

| `bitoarch start`                     | For recovery if AI Architect services stopped/killed due to system issues     |
| ------------------------------------ | ----------------------------------------------------------------------------- |
| `bitoarch stop`                      | Stop all services (keeps data)                                                |
| `bitoarch restart [--force]`         | Restart services. `--force` reloads env and recreates containers              |
| `bitoarch logs [service]`            | Tail service logs (`-f`). All services if `service` omitted                   |
| `bitoarch update`                    | Refresh service images per `versions/service-versions.json`                   |
| `bitoarch upgrade [--version=<ver>]` | Upgrade platform (latest by default). Blue/green tarball swap; data preserved |
| `bitoarch reset`                     | Remove services, volumes, and config. Keeps install directory                 |
| `bitoarch uninstall`                 | Full removal (services + install directory)                                   |

**Examples:**

```shellscript
bitoarch restart --force            # reload env + recreate containers
bitoarch logs cis-provider          # tail one service
bitoarch upgrade                    # upgrade to latest
bitoarch upgrade --version=1.8.0    # upgrade to a specific version
```

{% hint style="info" %}
Rollback is not supported after a successful upgrade. The tarball keeps the previous install at `<parent>/bito-ai-architect-<old>` until you remove it.
{% endhint %}

## AI Architect management commands

Use these `bitoarch` commands to manage AI Architect.

### Core operations

| Command                                          | Description                                                                                             | Example                                 |                                            |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------ |
| `bitoarch index-repos [--only-new-repos]`        | Trigger workspace repository indexing. Use `--only-new-repos` to index only newly added repositories    | `bitoarch index-repos --only-new-repos` |                                            |
| `bitoarch index-status [--raw] [--output json]`  | Check indexing status. `--raw` dumps the full API response; `--output json` emits machine-readable JSON | View progress and state                 |                                            |
| `bitoarch pause-indexing`                        | Pause ongoing indexing process                                                                          | `bitoarch pause-indexing`               |                                            |
| `bitoarch resume-indexing`                       | Resume paused indexing process                                                                          | `bitoarch resume-indexing`              |                                            |
| `bitoarch stop-indexing`                         | Stop indexing completely                                                                                | `bitoarch stop-indexing`                |                                            |
| \`bitoarch index-repo-list \[--status \<active\\ | all>] \[--limit <N>]\`                                                                                  | List indexed repositories               | `bitoarch index-repo-list --status active` |
| `bitoarch show-config`                           | Show current indexing configuration                                                                     | `bitoarch show-config --raw`            |                                            |
| `bitoarch create-index-scheduler`                | Create scheduled indexing tasks                                                                         |                                         |                                            |
| `bitoarch update-index-scheduler`                | Update existing scheduled indexing tasks                                                                |                                         |                                            |

**Examples:**

```shellscript
# Trigger repository indexing
bitoarch index-repos

# Check indexing status (default summary)
bitoarch index-status

# Full API response for debugging
bitoarch index-status --raw

# Machine-readable filtered JSON
bitoarch index-status --output json

# List all repositories
bitoarch index-repo-list --status active --limit 50
```

{% hint style="info" %}
One indexing job runs per workspace at a time. If you add a repo mid-run, re-trigger `bitoarch index-repos` after the current job finishes.
{% endhint %}

***

### Repository management

| Command                                      | Description                                                                      | Example                                    |
| -------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------ |
| `bitoarch add-repo <namespace>`              | Add single repository                                                            | `bitoarch add-repo myorg/myrepo`           |
| `bitoarch remove-repo <namespace>`           | Remove repository                                                                | `bitoarch remove-repo myorg/myrepo`        |
| `bitoarch add-repos [file]`                  | Load repos from YAML. Uses `.bitoarch-config.yaml` if `file` omitted             | `bitoarch add-repos`                       |
| `bitoarch update-repos [file]`               | Update repos from YAML. Uses `.bitoarch-config.yaml` if `file` omitted           | `bitoarch update-repos`                    |
| `bitoarch repo-info <name> [--dependencies]` | Show repository details (add `--dependencies` to include incoming/outgoing deps) | `bitoarch repo-info myrepo --dependencies` |
| `bitoarch fetch-repo-list [--force-load]`    | Sync repo list from your git provider. `--force-load` ignores local cache        | `bitoarch fetch-repo-list`                 |

**Examples:**

```shellscript
# Add a single repository
bitoarch add-repo myorg/myrepo

# Remove a repository
bitoarch remove-repo myorg/myrepo

# Load multiple repositories from default config file
bitoarch add-repos

# Load multiple repositories from a custom config file
bitoarch add-repos ./custom-repos.yaml

# Update configuration
bitoarch update-repos

# Get repository details
bitoarch repo-info myrepo
```

***

### Service operations

| Command           | Description                  | Example                     |
| ----------------- | ---------------------------- | --------------------------- |
| `bitoarch status` | View all services status     | Docker ps-like output       |
| `bitoarch health` | Check health of all services | `bitoarch health --verbose` |
| `bitoarch info`   | Get platform information     | Version, ports, resources   |

**Examples:**

```shellscript
# Check service status (docker ps-like)
bitoarch status

# Health check
bitoarch health

# Detailed health information
bitoarch health --verbose

# Platform information
bitoarch info
```

***

### Configuration

| Command                                   | Description                                                  | Example                                                            |                                                           |   |
| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------ | --------------------------------------------------------- | - |
| `bitoarch update-api-key`                 | Update Bito API key                                          | Interactive or with `--api-key [--restart]` flag                   |                                                           |   |
| `bitoarch update-git-creds`               | Update Git provider credentials                              | Interactive or with `--provider <p> --token <t> [--restart]` flags |                                                           |   |
| `bitoarch update-llm-keys`                | Update LLM API keys                                          | Interactive prompt                                                 |                                                           |   |
| `bitoarch rotate-mcp-token [<new-token>]` | Rotate MCP access token. Omit `<new-token>` to auto-generate | `bitoarch rotate-mcp-token <new-token>`                            |                                                           |   |
| \`bitoarch config path \[env\\            | repos\\                                                      | llm]\`                                                             | Print the absolute path of a config file (default: `env`) |   |
| \`bitoarch config edit \[env\\            | repos\\                                                      | llm]\`                                                             | Open a config file in `$EDITOR` (default: `env`)          |   |

**Config file types:**

| `env`   | `.env-bitoarch`         | Main environment config (ports, credentials, secrets) |
| ------- | ----------------------- | ----------------------------------------------------- |
| `repos` | `.bitoarch-config.yaml` | Repository list                                       |
| `llm`   | `.env-llm-bitoarch`     | Custom LLM provider configuration                     |

**Examples:**

```shellscript
# Update API key (interactive)
bitoarch update-api-key

# Update API key with flag
bitoarch update-api-key --api-key <key> --restart

# Update Git credentials (interactive)
bitoarch update-git-creds

# Update Git credentials with flags
bitoarch update-git-creds --provider github --token <token> --restart

# Update LLM API keys
bitoarch update-llm-keys

# Rotate MCP token - auto-generates a new MCP token
bitoarch rotate-mcp-token

# Rotate MCP token - set a specific MCP token manually
bitoarch rotate-mcp-token <new-token>

# prints path to .bitoarch-config.yaml
bitoarch config path repos

# edit .env-bitoarch
bitoarch config edit env
```

***

### MCP operations

| Command                                                        | Description                       | Example                                          |
| -------------------------------------------------------------- | --------------------------------- | ------------------------------------------------ |
| `bitoarch mcp-test`                                            | End-to-end MCP connectivity check | Verify server connectivity                       |
| `bitoarch mcp-tools [--details] [--summary] [--output <file>]` | List available MCP tools          | `bitoarch mcp-tools --details`                   |
| `bitoarch mcp-capabilities [--output <file>]`                  | Show MCP server capabilities      | `bitoarch mcp-capabilities --output caps.json`   |
| `bitoarch mcp-info`                                            | Show MCP configuration            | Show MCP URL, access token, and active auth mode |
| `bitoarch mcp-tool-info <name>`                                | Show details for one MCP tool     | `bitoarch mcp-tool-info search_code`             |

**Examples:**

```shellscript
# Test MCP connection
bitoarch mcp-test

# List MCP tools
bitoarch mcp-tools

# Show detailed tool information
bitoarch mcp-tools --details

# Get server capabilities
bitoarch mcp-capabilities

# Save capabilities to file
bitoarch mcp-capabilities --output capabilities.json

# Show MCP configuration
bitoarch mcp-info

# Show details for one MCP tool (e.g. search_code)
bitoarch mcp-tool-info search_code
```

***

### SSO authentication

SSO is optional and disabled by default (bearer-token auth). When enabled, `bitoarch mcp-info` reflects the active auth mode.

| Command                   | Description                                                                                                                                                                                                                                                                        |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bitoarch sso setup`      | This command will guide you through the SSO configuration process, including choosing between Enterprise IdP and Bito authentication                                                                                                                                               |
| `bitoarch sso status`     | Displays the current SSO configuration and IdP connection status                                                                                                                                                                                                                   |
| `bitoarch sso enable`     | Re-enable SSO after it has been temporarily disabled                                                                                                                                                                                                                               |
| `bitoarch sso disable`    | You can disable SSO either temporarily or permanently. Choose temporary to turn off SSO authentication but preserve IdP configuration (can re-enable with `bitoarch sso enable`), or permanent to remove IdP configuration entirely (requires `bitoarch sso setup` to reconfigure) |
| `bitoarch sso rotate-key` | Rotate SSO management key for security purposes. Important: After rotating the key, SSO services will restart automatically. Active sessions may need to re-authenticate                                                                                                           |

**Auth modes:**

| Bearer Token   | Default — static MCP access token (SSO disabled)       |
| -------------- | ------------------------------------------------------ |
| Bito           | SSO via Bito — no external IdP required                |
| Enterprise IdP | SSO via your SAML/OIDC provider (Okta, Azure AD, etc.) |

### Output options

Add these flags to any command:

| Flag            | Purpose                | Example                |
| --------------- | ---------------------- | ---------------------- |
| `--format json` | JSON output            | For automation/scripts |
| `--raw`         | Show full API response | For debugging          |
| `--output json` | Filtered JSON output   | For `index-status`     |
| `--help`        | Show command help      | Get usage information  |

***

### Common workflows

#### Initial setup

```shellscript
# 1. Check services are running
bitoarch status

# 2. Add repositories - load repos from .bitoarch-config.yaml file
bitoarch add-repos

# 3. Trigger indexing
bitoarch index-repos

# 4. Monitor progress
bitoarch index-status

# 5. Grab MCP URL + token for your client
bitoarch mcp-info
```

#### Daily operations

```shellscript
# Check health
bitoarch health

# View repositories
bitoarch index-repo-list

# Check index status
bitoarch index-status
```

#### Adding new repositories

```shellscript
# Single repository
bitoarch add-repo myorg/newrepo

# Multiple repositories from config file
bitoarch add-repos

# Trigger re-indexing
bitoarch index-repos --only-new-repos
```

#### Credential rotation

```shellscript
# Update Bito API key
bitoarch update-api-key

# Update Git provider credentials
bitoarch update-git-creds

# Rotate MCP access token
bitoarch rotate-mcp-token

# Rotate SSO management key for security purposes.
# only if SSO is enabled
bitoarch sso rotate-key
```

#### Tear-down

```shellscript
# pause services
bitoarch stop

# remove services + volumes + config (keeps install dir)
bitoarch reset

# full removal
bitoarch uninstall
```

#### Troubleshooting

```shellscript
# Check all services
bitoarch status
bitoarch health --verbose

# View full configuration
bitoarch show-config --raw

# Test MCP connection
bitoarch mcp-test

# Check indexing status with details
bitoarch index-status --raw

# Check logs of all services
bitoarch logs

# Check logs of one service
bitoarch logs cis-manager
```

***

### Getting help

| Command                     | Shows                            |
| --------------------------- | -------------------------------- |
| `bitoarch --help` \| `-h`   | Top-level help with all commands |
| `bitoarch <command> --help` | Command-specific usage and flags |

**Examples:**

```shellscript
# Main help
bitoarch --help

# Command help
bitoarch index-repos --help
bitoarch add-repo --help
bitoarch mcp-tools --help
```

***

### Environment

Configuration is loaded from `.env-bitoarch` file. (path: `bitoarch config path env`)

**Key variables:**

| Variable                     | Purpose                                        |
| ---------------------------- | ---------------------------------------------- |
| `BITO_API_KEY`               | Bito authentication key                        |
| `GIT_PROVIDER`               | Git provider (`github`, `gitlab`, `bitbucket`) |
| `GIT_ACCESS_TOKEN`           | Git personal access token                      |
| `BITO_MCP_ACCESS_TOKEN`      | MCP server access token                        |
| `CIS_PROVIDER_EXTERNAL_PORT` | MCP server port (default 8080 for k8s)         |
| `CIS_MANAGER_EXTERNAL_PORT`  | Manager API port                               |
| `CIS_CONFIG_EXTERNAL_PORT`   | Config API port                                |
| `CIS_TRACKER_EXTERNAL_PORT`  | Tracker API port                               |
| `MYSQL_EXTERNAL_PORT`        | MySQL external port                            |

{% hint style="info" %}
**Note:** See `.env-bitoarch.default` in the install directory for the full list with defaults.
{% endhint %}

***

### Version

Check CLI version:

```shellscript
bitoarch --version
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bito.ai/ai-architect/installation/install-ai-architect-self-hosted/available-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
