Skip to main content

Overview

The sam docs command starts a local HTTP server to view the Solace Agent Mesh documentation that’s bundled with the installation. This provides offline access to the complete documentation.

Syntax

sam docs [OPTIONS]

Options

-p, --port
integer
default:"8585"
Port to run the documentation server on.
-h, --help
flag
Show help message and exit.

Description

The docs command searches for the built-in documentation in two locations:
  1. Production documentation: <install-dir>/assets/docs (for installed packages)
  2. Development documentation: <repo-root>/docs/build (for development environments)
When you run the command, it:
  • Starts an HTTP server on the specified port (default: 8585)
  • Opens your default web browser to the documentation
  • Redirects 404 errors to the introduction page
  • Serves documentation at /solace-agent-mesh/docs/documentation/getting-started/introduction/

Examples

Start documentation server on default port

sam docs
Output:
Starting documentation server on http://localhost:8585/solace-agent-mesh/docs/documentation/getting-started/introduction/

Start on custom port

sam docs --port 9000
Output:
Starting documentation server on http://localhost:9000/solace-agent-mesh/docs/documentation/getting-started/introduction/

View in development mode

If you’re working from the source repository with a built docs directory:
sam docs
Output:
Serving development documentation
Starting documentation server on http://localhost:8585/solace-agent-mesh/docs/documentation/getting-started/introduction/

Implementation

The command uses Python’s built-in http.server module with a custom request handler that:
  • Rewrites paths starting with /solace-agent-mesh to serve from the root
  • Redirects 404 errors to the introduction page for a better user experience
Source: cli/commands/docs_cmd.py

Stopping the server

Press Ctrl+C to stop the documentation server:
^C
Shutting down documentation server...

Troubleshooting

Error: Documentation directory not found. Please build the documentation first.Solution: This means neither the production nor development documentation directories exist. If you’re working from source, build the documentation first. If you installed via pip, the documentation should be included automatically.
Error: OSError: [Errno 48] Address already in useSolution: Another process is using port 8585. Either:
  • Stop the other process
  • Use a different port: sam docs --port 8586
If your browser doesn’t open automatically, manually navigate to the URL shown in the terminal output (e.g., http://localhost:8585/solace-agent-mesh/docs/documentation/getting-started/introduction/).

See also

Build docs developers (and LLMs) love