Skip to content
Weik.io
Book a demoTry Weik.io

GitOps and the CLI

Your pipeline applies your integrations, variables, channels, APIs and what runs where from your Git repository with the weikio CLI. Weik.io needs no Git credentials and no network path to your Git host. Secret values go into Weik.io and never into the repository.

From pull request to production

The example repository contains the project finance. Its shared documents (integrations, channels and APIs) are in finance/shared. What runs in each environment is in finance/devtest and finance/production.

A change starts in a folder in Git. A pull request runs weikio diff, and the pipeline posts the plan as a comment. The merge runs weikio apply and the change reaches devtest. Promoting a tested version to production is a pull request that changes the version, and production applies it after the repository's required reviewers approve. git revert rolls a change back through the same steps.

  1. Plan in the pull request

    The pull request workflow runs weikio diff with the devtest key and posts its output as a comment. In the comment you see the versions an apply would create, the variables that change, the deployments that move and what it would delete. If a changed integration has no new version, weikio diff marks it as refused and fails the check before anyone merges.

    Terminal
    $ weikio diff -f ./finance/shared -f ./finance/devtest --env devtest --prune finance
  2. Merge to apply to devtest

    On merge to main the devtest workflow applies the integrations, channels, APIs, variables and deployments in one call. Weik.io builds each changed integration once, in this step. You deploy the same versions to the other environments.

    Terminal
    $ weikio apply -f ./finance/shared \
        -f ./finance/devtest --env devtest --prune finance -y
  3. Promote with a pull request

    To promote, change the version in the production deployment file. The reviewer then sees what will run.

    finance/production/deployments/erp-invoice-export.yaml
    apiVersion: weik.io/v1
    kind: deployment
    metadata: { name: erp-invoice-export, project: finance, environment: production }
    spec: { version: 1.1.0, state: started }
  4. Apply to production after review

    The production workflow plans in a job of its own. Its apply job waits in GitHub's production environment until the required reviewers have read the plan and approved.

    Terminal
    $ weikio apply -f ./finance/production --env production --prune finance -y
  5. Roll back with a revert

    A revert of the promotion goes through the same review and puts the earlier version back without a build. In an incident, weikio rollback puts the earlier version back. The next apply from Git sets the deployment back to the version in the repository.

    Terminal
    $ git revert a1b2c3d

The workflow file

In GitHub Actions, the production workflow is a plan job and an apply job. Any CI system that runs a shell command works the same way.

.github/workflows/production.yaml
name: production
on:
  push:
    branches: [main]
    paths: ['finance/**']
env:
  WEIKIO_SERVER: https://weikio.example.com
jobs:
  plan:                                     # the diff the reviewers read before they approve
    runs-on: ubuntu-latest
    environment: production-plan            # has the production key, no reviewers
    env:
      WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - run: |                              # installs the CLI, pinned version, and gives the commit's subject line as the reason
          curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
      - run: weikio diff -f ./finance/production --env production --prune finance || [ $? -eq 2 ]
  apply:
    needs: plan
    runs-on: ubuntu-latest
    environment: production                 # waits for GitHub's required reviewers
    env:
      WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - run: |
          curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
      - run: printf '%s' "$ERP_API_KEY" | weikio secret set finance/erp-api-key --env production -y
        env:                                # after the approval, like the apply
          ERP_API_KEY: ${{ secrets.ERP_API_KEY }}
      - run: weikio apply -f ./finance/production --env production --prune finance -y

What keeps it safe

Keys per environment

For each repository, you create one API key per environment and give it the deployer role on the repository's projects. The devtest key can't change production even if someone edits the workflow. In the audit log, you see the key and the commit's subject line as the reason for each change.

Docs: Keep integrations in Git

Prune and drift

--prune deletes only what is no longer in the folder. weikio diff --prune exits non-zero when Weik.io differs from the folder. Run it nightly against production as your drift check.

Docs: Drift and export

Export

weikio export writes every document of a project, or of the installation, as YAML that applies again unchanged. Secrets come out without their values.

Docs: Drift and export

The commit in the audit log

The CLI records the repository, branch and commit of every apply from a pipeline. weikio describe integration shows applied from weikio-integrations@a1b2c3d. In the audit log, you open the commit from the apply's record.

Docs: Audit log
/settings/audit
The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.The Audit log filtered to deployment changes. Anna Virtanen made the version changes in devtest and production and gave a reason for each.
In the Audit log, you see each change with the person who made it and the reason they gave. You also see the matching weikio audit query line.

The CLI

The weikio commands that read or change Weik.io call its HTTP API. You publish a version with apply and run it in an environment with deploy. While you develop, run does both.

weikio --help groups the commands under Getting started, Develop, Deploy and run, Configuration, Events and data, APIs, Agents, Access and Administration. Commands print tables for people and accept -o json and -o yaml for scripts. Completion is available for bash, zsh, fish and PowerShell.

CLI reference

$ curl -fsSL https://weik.io/install.sh | sh

Changes in the admin UI

Changes made in the admin UI are versions like any other. In a dialog, you see the CLI line that does the same thing. A change saved in the browser is in the audit log with the person who made it. To get it into Git, run weikio export.

/settings/projects/finance/members
The Grant project access dialog for pekka.niemi@example.com with the role deployer in devtest and the matching weikio member add lineThe Grant project access dialog for pekka.niemi@example.com with the role deployer in devtest and the matching weikio member add lineThe Grant project access dialog for pekka.niemi@example.com with the role deployer in devtest and the matching weikio member add lineThe Grant project access dialog for pekka.niemi@example.com with the role deployer in devtest and the matching weikio member add line
In the Grant access dialog, you give a person a role on a project in the environments you choose and see the matching weikio member add line.

Editors

Weik.io serves the JSON schema of every document kind at GET /api/v1/schemas/{kind}. The schemas are also in the schemas/ folder of the GitHub repository. The YAML language server validates and completes your files with them in Visual Studio Code and other editors.

Questions

Does Weik.io pull from my repository?

No, your pipeline pushes with the CLI. Weik.io needs no Git credentials and no network path to your Git host.

Which CI systems work?

Any CI system that runs a shell command works. For GitHub Actions, you find complete workflows for the plan, devtest and production in the docs.

Can I work without Git?

Yes, the admin UI and the CLI change the same documents. When you want them in Git, weikio export writes them out.

Where do secret values go?

Secret values go into Weik.io with weikio secret set, from a terminal or from a pipeline step after the approval. They never go into the repository.

Read the GitOps docs

In the guide, you set up the plan workflow and the devtest and production workflows in your repository.

Sign in to the live demo

Sign in with the shared viewer account. It can open every screen of the example projects but can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo