Context7 Platform -- Up-to-date docs for AI agents
CTX7-2681: Document Docs7 login and deployment commands (#3215)
Enes Gules12db78ea0439
diff --git a/docs/docs.json b/docs/docs.jsonindex 159e49a7..41e750b7 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -275,6 +275,7 @@"group": "Reference","expanded": false,"pages": [+ "docs7/cli",{"group": "Components","expanded": false,diff --git a/docs/docs7/builds.mdx b/docs/docs7/builds.mdxindex 54595f1d..eaf56877 100644--- a/docs/docs7/builds.mdx+++ b/docs/docs7/builds.mdx@@ -3,7 +3,7 @@ title: Buildsdescription: Configure production builds, previews, and local builds----Connect a GitHub repository once. Docs7 then reads the configured documentation folder whenever it builds that site.+Publish from a connected GitHub repository or upload local files with [`docs7 deploy`](/docs7/cli#deploy). For GitHub sites, Docs7 reads the configured documentation folder whenever it builds.The folder must contain `docs.json` or `mint.json`. It can also contain MDX pages, assets, snippets, OpenAPI files, and any other files referenced by the documentation.@@ -16,7 +16,7 @@ The folder must contain `docs.json` or `mint.json`. It can also contain MDX page## Build settings-Open **Docs7**, choose a site, then open **Settings**.+For a GitHub site, open **Docs7**, choose a site, then open **Settings**.| Setting | What it controls || --- | --- |@@ -28,13 +28,14 @@ Branch and docs path changes take effect on the next deployment. You can also se## Production builds-Docs7 starts a production build in three cases:+Docs7 starts a production build when:1. You publish a site for the first time.2. You push a commit to the production branch.3. You click **Redeploy** in Docs7.+4. You run `docs7 deploy` for a CLI site.-For each build, Docs7 resolves the exact commit, checks out the repository, and reads the configured docs path. It then renders the pages, builds the search index, runs documentation health checks, and publishes the completed release.+For GitHub builds, Docs7 resolves the exact commit, checks out the repository, and reads the configured docs path. CLI builds use the uploaded local files instead. Both render the pages, build the search index, run documentation health checks, and publish the completed release.Publication happens only after the release is ready. If a build fails, the previous successful release stays live.@@ -59,7 +60,7 @@ You can also create a preview for a selected branch manually. Open a preview bui## Inspect a build-Open **Builds**, then select a row. Each build records its branch, commit, trigger, status, and commit message.+Open **Builds**, then select a row. GitHub builds record the branch, commit, trigger, status, and commit message. For CLI sites, open the overview link from the command and select a deployment. These builds show a CLI source instead of a Git branch or commit.The detail view contains:@@ -67,7 +68,7 @@ The detail view contains:- **Files changed** for pull request builds- **Health** for page errors, broken internal links, unknown components, source warnings, and deployment failures-Fixable issues from the latest production build also appear in the [Agent work queue](/docs7/agent#context7-agent).+For GitHub sites, fixable issues from the latest production build also appear in the [Agent work queue](/docs7/agent#context7-agent).## Build locally@@ -86,7 +87,7 @@ docs7 dev ./docs --host 0.0.0.0Use `--port` to change the port and `--host` to bind another address. The first run downloads the Docs7 renderer and caches it for later previews.-The public CLI previews documentation but does not publish it. Push the repository or click **Redeploy** to start a hosted build.+To publish local files, run `docs7 login`, then `docs7 deploy`. See the [CLI reference](/docs7/cli) for production and preview deployments.<Warning>A local preview executes trusted MDX with your local user permissions. Do not run it against a documentation source you do not trust.diff --git a/docs/docs7/cli.mdx b/docs/docs7/cli.mdxnew file mode 100644index 00000000..514c878a--- /dev/null+++ b/docs/docs7/cli.mdx@@ -0,0 +1,124 @@+---+title: CLI+description: Preview, sign in, and deploy documentation with the Docs7 CLI+---++## Install++Use Node.js 20.19 or newer:++```bash+npm install -g @upstash/docs7+```++You can also run commands without a global installation, such as `npx @upstash/docs7 deploy`.++| Command | What it does |+| -------------------- | ------------------------------------------------- |+| `docs7 dev [dir]` | Preview your docs locally with live reload. |+| `docs7 login` | Sign in with your Context7 account. |+| `docs7 whoami` | Show your saved login status and teamspace. |+| `docs7 logout` | Remove your saved Docs7 login. |+| `docs7 deploy [dir]` | Upload your local docs and publish to production. |++For `dev` and `deploy`, the directory defaults to the current folder. It must contain `docs.json` or `mint.json`.++## Sign in++```bash+docs7 login+```++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:++```bash+docs7 login --no-browser+```++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++```bash+docs7 dev+docs7 dev ./docs --port 4000+```++The default address is `http://localhost:3333`. 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.++<Warning>+ A local preview executes MDX with your local user permissions. Only preview documentation sources+ you trust.+</Warning>++## Deploy++After login, run this from your documentation folder:++```bash+docs7 deploy+```++Or pass the folder:++```bash+docs7 deploy ./docs+```++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 and at most 100 characters. 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.++<Note>+ Free teamspaces can have one site across GitHub and CLI deployments. Preview deployments require+ Pro. Updating an existing site does not count as adding a site.+</Note>++### Deploy options++| Option | What it does |+| --------------- | ------------------------------------------------------------------------------------------ |+| `--preview` | Create a preview without replacing production. Requires Pro. |+| `--slug <slug>` | Request the site's address when you first create it. Not available for a linked directory. |++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:++```bash+docs7 deploy --preview+```++### Files in the upload++Docs7 excludes common private paths, symbolic links, and build folders such as `node_modules`, `.next`, and `dist`.++Add project-specific exclusions to `.docs7ignore` or `.mintignore` in the documentation folder:++```text .docs7ignore+drafts/+internal-notes.md+```++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](/docs7/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.++<Warning>+ If you downgrade from Pro to Free, you cannot keep a CLI-only site. The downgrade confirmation+ lists it for removal. Deploy it again after the downgrade.+</Warning>diff --git a/docs/docs7/overview.mdx b/docs/docs7/overview.mdxindex 44bf843d..b6678924 100644--- a/docs/docs7/overview.mdx+++ b/docs/docs7/overview.mdx@@ -3,7 +3,7 @@ title: Introdescription: A documentation platform built for the way agents read, search, and decide----Docs7 turns your existing GitHub repository into fast, beautiful documentation for people and clean, structured context for agents.+Docs7 turns your local documentation or GitHub repository into fast, beautiful documentation for people and clean, structured context for agents.## ❌ Without Docs7diff --git a/docs/docs7/quickstart.mdx b/docs/docs7/quickstart.mdxindex fef34892..615f67f7 100644--- a/docs/docs7/quickstart.mdx+++ b/docs/docs7/quickstart.mdx@@ -38,7 +38,7 @@ Hello, world.## 2. Install the CLI-Install the package globally:+Use Node.js 20.19 or newer. Install the package globally:```bashnpm install -g @upstash/docs7@@ -68,6 +68,23 @@ docs7 dev ./docs --port 4000## 4. Publish+### With the CLI++Run these commands from your documentation folder:++```bash+docs7 login+docs7 deploy+```++The login command shows a one-time code and an approval link. Press Enter to open the browser, then approve access with your Context7 account.++`docs7 deploy` publishes to production without a GitHub repository. It shows the site overview link and prints the public URL when the build is ready.++Run `docs7 deploy` again after you edit your docs to update the same site. Keep `.docs7/project.json`, which stores the site link. See the [CLI reference](/docs7/cli) for login options, previews, and upload exclusions.++### With GitHub+1. Push the project to GitHub.2. Open the **Docs7** tab in your Context7 teamspace.3. Click **Add New Site** and choose the repository.