Deploying

Deploy your documentation to Specra Cloud, manage projects, and view deployment logs

Deploying

The Specra CLI lets you deploy documentation to Specra Cloud, list your projects, and view deployment logs — all from the terminal.

Deploy

Code
bash
1create-specra deploy

This packages your docs directory into an archive and uploads it to Specra Cloud. The CLI will:

  1. Check that you're authenticated (run create-specra login first)
  2. Read projectId from your specra.config.json
  3. Create a compressed archive of your docs
  4. Upload and trigger a deployment

Specifying a Project

If your specra.config.json has a projectId field, it's used automatically:

Code
json
1{
2 "site": {
3 "title": "My Docs",
4 "projectId": "proj_abc123"
5 }
6}

If no projectId is found, the CLI fetches your projects and prompts you to pick one:

Select a project to deploy to:
  1. My Docs (my-docs.docs.specra.dev)
  2. API Reference (api-ref.docs.specra.dev)

You can also specify the project directly:

Code
bash
1create-specra deploy --project proj_abc123

Deploying a Different Directory

By default, the CLI deploys from the current directory. Use --dir to specify a different path:

Code
bash
1create-specra deploy --dir ./my-docs-project

Git Integration

The CLI automatically detects if you're in a git repository and includes the current commit SHA with the deployment. This appears in your deployment dashboard for traceability.

Options Reference

OptionDescription
-p, --project <id>Project ID to deploy to (skips prompt)
-d, --dir <directory>Docs directory to deploy (default: .)

Projects

List all your Specra Cloud projects:

Code
bash
1create-specra projects

Output:

Projects (2):

  My Docs (proj_abc1)  running
    my-docs.docs.specra.dev

  API Reference (proj_def2)  not_deployed
    api-ref.docs.specra.dev
    docs.example.com

Each project shows:

  • Name and short ID
  • Deployment status (running, failed, building, not_deployed)
  • Subdomain on specra.dev
  • Custom domain if configured

Logs

View deployment logs for a project:

Code
bash
1create-specra logs <projectId>

By default, this shows logs for the most recent deployment. To view a specific deployment:

Code
bash
1create-specra logs proj_abc123 --deployment dep_xyz789

The output includes:

  • Deployment ID, status, trigger source, and timestamp
  • Build logs — output from the build process
  • Container logs — runtime logs from the deployed container

Options Reference

OptionDescription
--deployment <id>View logs for a specific deployment ID

CI/CD Integration

You can use the Specra CLI in your CI/CD pipelines. Here's an example with GitHub Actions:

Code
yaml
1name: Deploy Docs
2on:
3 push:
4 branches: [main]
5 
6jobs:
7 deploy:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v4
11 
12 - uses: actions/setup-node@v4
13 with:
14 node-version: 20
15 
16 - run: npm install -g create-specra@latest
17 
18 - name: Deploy to Specra Cloud
19 run: specra deploy --project ${{ secrets.SPECRA_PROJECT_ID }}
20 env:
21 SPECRA_TOKEN: ${{ secrets.SPECRA_TOKEN }}
Info
For CI/CD, store your token using `specra login --global` on your local machine, then copy the token from `~/.specra/config.json` to your CI secrets.