Overview
Thesam 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
Options
Port to run the documentation server on.
Show help message and exit.
Description
Thedocs command searches for the built-in documentation in two locations:
- Production documentation:
<install-dir>/assets/docs(for installed packages) - Development documentation:
<repo-root>/docs/build(for development environments)
- 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
Start on custom port
View in development mode
If you’re working from the source repository with a built docs directory:Implementation
The command uses Python’s built-inhttp.server module with a custom request handler that:
- Rewrites paths starting with
/solace-agent-meshto serve from the root - Redirects 404 errors to the introduction page for a better user experience
cli/commands/docs_cmd.py
Stopping the server
PressCtrl+C to stop the documentation server:
Troubleshooting
Documentation directory not found
Documentation directory not found
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.Port already in use
Port already in use
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
Browser doesn't open automatically
Browser doesn't open automatically
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
- sam —version - Check installed version
- Online Documentation - Latest online docs