Skip to main content

Install

Use Node.js 20.19 or newer:
You can also run commands without a global installation, such as npx @upstash/docs7 deploy. For dev and deploy, the directory defaults to the current folder. It must contain docs.json or mint.json.

Sign in

The CLI shows a one-time code and an approval link. Press Enter to open the browser, then approve access with your Context7 account. To open the link yourself, including on another device:
Use docs7 whoami to check your login. To change accounts, run docs7 logout, then docs7 login again. Docs7 stores its login in ~/.config/docs7/credentials.json. If XDG_CONFIG_HOME is an absolute path, it uses that directory instead of ~/.config. Docs7 does not read or change credentials saved by ctx7 login. For deployment without browser login, set CONTEXT7_API_KEY in your environment, such as a CI secret. This key takes priority over the saved login for docs7 deploy. docs7 logout removes only the saved login, not the environment variable.

Preview locally

The default address is http://localhost:3000. If that port is in use, the server uses the next free port and prints the address. If you set --port and the port is in use, the command stops. The first run downloads the renderer and caches it. The server reloads pages when you edit files. Use --host to change the bind address. Local previews do not require login.
A local preview executes MDX with your local user permissions. Only preview documentation sources you trust.

Deploy

After login, run this from your documentation folder:
Or pass the folder:
No GitHub repository is required. The CLI uploads your local files, shows the site overview and deployment links, and waits for the build. It prints the public URL when the site is ready. The first deployment creates a site using the required name in docs.json or mint.json. The name must be nonempty. Docs7 assigns an available *.docs7.io address from the name. The CLI saves the site ID in .docs7/project.json inside the documentation folder. Keep this file. Later runs update that same site, even if the assigned address differs from the name. They do not create another site or use another site slot.
Free teamspaces can have three sites. Updating an existing site does not count as adding a site.

Deploy options

To request an address for a new site, use docs7 deploy --slug acme-docs on its first deployment. For later updates, run docs7 deploy without --slug. To create a preview:

Files in the upload

Docs7 excludes common private paths, symbolic links, and build folders such as node_modules, .next, and dist. It also excludes all files and folders whose names start with a dot, except .docs7ignore, .mintignore, and .gitignore in the documentation root. Add project-specific exclusions to .docs7ignore or .mintignore in the documentation folder:
.docs7ignore
The upload does not use .gitignore rules. This lets you deploy generated docs that Git ignores. Check the folder for private files and add exclusions before you deploy.

Connect GitHub later

Open the overview link from the CLI and select Connect GitHub. The site keeps its address and deployment history. After connection, GitHub becomes the source. Push to the connected production branch to update the site. The CLI will no longer deploy to it. See Builds for automatic deployments and pull request previews. Until you connect GitHub, use docs7 deploy for updates. Automatic GitHub deployments, pull request previews, and Docs7 agents are not available.

Downgrade to Free

When you downgrade from Pro to Free, you can keep up to three sites, including your CLI sites. Each CLI site that you keep keeps its address, deployment history, and saved link in .docs7/project.json. Continue to update it with docs7 deploy. The current published build stays online. Free-plan branding applies on the next deployment. Sites you do not select are removed.