@upstash/docs7
v0.1.12
Published
Develop and deploy Docs7 documentation sites
Readme
@upstash/docs7
The Docs7 command line. Preview a docs.json (or legacy mint.json) documentation project on your machine, or deploy it to Docs7.
npx @upstash/docs7 devor install it once and use the docs7 command:
npm install -g @upstash/docs7
docs7 devRun it inside a docs project, or pass the project directory. The preview runs at http://localhost:3000 (or the next free port) and reloads pages as you edit them.
docs7 dev ./docs -p 4000Sign in with your Context7 account:
docs7 loginThe command shows a one-time code and an approval link. Press Enter to open the
browser, then approve access with your Context7 account. Use
docs7 login --no-browser to open the link yourself, including from another device.
docs7 whoami shows your login status. docs7 logout removes the saved login.
Docs7 stores credentials in ~/.config/docs7/credentials.json, or under
$XDG_CONFIG_HOME/docs7 when XDG_CONFIG_HOME is an absolute path. Docs7 uses
private file permissions on macOS and Linux and a current-user access control
list on Windows. System administrators can still access the file. Docs7 does not read or change the
Context7 CLI credentials.
After login, deploy your project:
docs7 deployThe first deployment creates a site from the required name in docs.json, links the directory in .docs7/project.json, and publishes it. Later deployments from that directory use the saved site ID and update the same website. They do not create another website or use another Free site slot. The command shows the Context7 overview link while it builds. It prints the final public URL when the deployment is ready.
Docs7 removes common private and build paths from the upload. Add project-specific exclusions to .docs7ignore or .mintignore. Git-ignored generated documentation stays available for local deployment.
Keep .docs7/project.json to preserve this link. Only one docs7 deploy can run in the same directory at a time. Use --preview to create a preview instead. You can set the initial slug when the site is first created.
You can connect the site to GitHub from its Context7 overview. The site keeps its URL and deployment history. After you connect it, GitHub is the source: push to the connected repository to deploy new changes. docs7 deploy then tells you to use GitHub.
docs7 deploy --preview
docs7 deploy --slug acme-apiCommands
| Command | What it does |
| --- | --- |
| docs7 dev [dir] | Preview the project with live reload. -p, --port <port> (default: the first free port from 3000), --host <host> (default 127.0.0.1). |
| docs7 login [--no-browser] | Sign in through the browser with a one-time code. |
| docs7 logout | Remove your saved Docs7 credentials. |
| docs7 whoami | Show your login status. |
| docs7 deploy [dir] | Upload and publish the project. --preview creates a preview; --slug applies when the site is first created. |
How it works
The package is small on purpose. On the first docs7 dev it downloads the Docs7 renderer — a prebuilt production build of the same renderer that publishes Docs7 sites — into ~/.docs7/renderer/ (about 30 MB) and reuses it after that. Every run checks for a newer renderer; when you are offline it keeps using the installed one.
Environment variables:
| Variable | Purpose |
| --- | --- |
| DOCS7_HOME | Cache directory. Default ~/.docs7. |
| DOCS7_RELEASES_URL | Where renderer releases come from. Default https://b3a38d39ac3c.blob.upstash.io. |
| DOCS7_RELEASES_PUBLIC_KEY | PEM public key that releases from a custom DOCS7_RELEASES_URL are verified against. Default: the Docs7 release key. |
| DOCS7_RENDERER_VERSION | Pin one renderer release. |
| DOCS7_ASSISTANT_PROXY_URL | Backend for the Ask AI panel while previewing. |
| DOCS7_API_URL | Context7 app URL. Default https://context7.com. |
| XDG_CONFIG_HOME | Config directory. Default ~/.config. Docs7 stores credentials in its docs7 subdirectory. |
| CONTEXT7_API_KEY | Context7 API key for deployment. If unset, Docs7 uses the credentials saved by docs7 login. |
Requires Node.js 20.19 or newer.
Development (this repository)
The renderer that dev runs is built from renderer/ with npm run release --prefix renderer and lands in renderer/.release/renderer. Run the CLI against it without downloading anything:
node cli/bin/docs7.mjs dev renderer/docs/mock --renderer renderer/.release/renderernpm test --prefix cli runs the CLI's tests. Publishing is described in .github/workflows/publish-cli.yml; renderer releases in .github/workflows/release-renderer.yml.
Authentication is copied from packages/cli/src/commands/auth.ts and
packages/cli/src/utils/auth.ts in upstash/context7 at commit
e127fa1.
