---
title: Archbee CLI Command Examples
slug: docs/archbee-cli-command-examples
docTags: 
createdAt: 2026-08-25T09:37:14.516Z
---

## Archbee CLI Command Examples

This guide shows common Archbee CLI workflows with practical command examples.

Most local development commands can run without authentication. Commands that interact with content on the Archbee platform usually require both an API key and a space ID.

## Local Development

Use these commands while writing or testing documentation locally.

Preview your docs with live reload during development:

```bash
archbee dev
```

Example output:

```text
Archbee local server running at http://localhost:3000
Watching files for changes...
```

The local site typically runs on:

```text
http://localhost:3000
```

Validate your documentation structure and configuration:

```bash
archbee validate
```

Example output:

```text
✓ Configuration valid
✓ No structural issues found
```

This command helps detect missing config files, invalid structures, and other common setup issues.

Check for broken internal links:

```bash
archbee broken-links
```

Example output:

```text
Scanning documentation...
✓ No broken links found
```

This is useful before publishing changes.

## Managing Documents

Most document management commands require:

- `--api-key`
- `--doc-space-id`

Search for documents inside a documentation space:

```bash
archbee search-docs --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
Found 12 matching documents
```

Retrieve a document by ID:

```bash
archbee get-doc DOC_ID --format markdown --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
Document exported successfully
```

The `--format` flag supports formats such as markdown, html, json, and source.

Create a new document or update an existing one from a local markdown file:

```bash
archbee create-doc ./doc.md --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
Document created successfully
```

Delete a document from a space:

```bash
archbee delete-doc DOC_ID --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
Document deleted successfully
```

Use delete commands carefully because they directly affect published documentation.

## OpenAPI Workflows

The Archbee CLI can import and synchronize OpenAPI specifications to generate API reference documentation.

Sync an OpenAPI file into a documentation space:

```bash
archbee sync-openapi openapi.yaml --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
OpenAPI sync completed successfully
```

Retrieve information about an existing OpenAPI documentation tree:

```bash
archbee info-openapi TREE_ID --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
OpenAPI tree contains 24 endpoints
```

If synchronization fails, validate the OpenAPI schema before retrying.

## File Manager Commands

The CLI can also manage uploaded files directly from the terminal.

Upload a file:

```bash
archbee upload ./logo.png --api-key YOUR_API_KEY
```

Example output:

```text
File uploaded successfully
```

List uploaded files and folders:

```bash
archbee list-files --api-key YOUR_API_KEY
```

Example output:

```text
Found 42 files
```

Replace an existing file while keeping the same public URL:

```bash
archbee replace-file FILE_ID ./new-logo.png --api-key YOUR_API_KEY
```

Example output:

```text
File replaced successfully
```

:::hint{type="info"}
The `replace-file` command updates a file while preserving the same public URL, which helps avoid broken links in documentation.
:::

## Publishing Changes

Publish documentation updates to production:

```bash
archbee publish-space --api-key YOUR_API_KEY --doc-space-id SPACE_ID
```

Example output:

```text
Space published successfully
```

Make sure the API key has write permissions before publishing.

## Getting Command Help

Every CLI command supports the `--help` flag.

```bash
archbee <command> --help
```

Example:

```bash
archbee create-doc --help
```

Example output:

```text
Usage: archbee create-doc [options]
```

This displays all supported flags, arguments, and usage examples for the selected command.

## Additional Resources

- [https://archbee.com/docs](https://archbee.com/docs)
- [https://www.npmjs.com/package/@archbee/cli](https://www.npmjs.com/package/@archbee/cli)
