Skip to content

Getting Started

This guide shows a practical first setup for iFlowKit CLI.

0. Build and run

From the repository root:

bash
go build ./cmd/iflowkit

This creates a local binary, usually named iflowkit.

1. Show local paths

Use where to see local configuration paths and current profile context:

bash
iflowkit where

Configuration root is based on os.UserConfigDir():

text
{user-config-dir}/iflowkit

2. Initialize developer config

bash
iflowkit config init
iflowkit config show

Developer config stores CLI preferences that are not specific to a customer profile.

3. Create and select a profile

bash
iflowkit profile init
iflowkit profile list
iflowkit profile use --id {profileId}
iflowkit profile current

A profile represents a customer or working context. Tenant service keys are stored under profiles.

4. Add tenant service keys

Import from JSON

bash
iflowkit tenant import --file service-key-dev.json --env dev
iflowkit tenant import --file service-key-qas.json --env qas
iflowkit tenant import --file service-key-prd.json --env prd

Set fields directly

bash
iflowkit tenant set --env dev \
  --url https://{cpi-host}/ \
  --token-url https://{oauth-host}/oauth/token \
  --client-id {id} \
  --client-secret {secret}

5. Configure Git provider token

Sync workflows may create or push Git repositories. Use environment variables for tokens.

Preferred:

bash
export IFLOWKIT_GIT_TOKEN={token}

Supported fallbacks:

bash
export GITHUB_TOKEN={token}
export GH_TOKEN={token}
export GITLAB_TOKEN={token}
export GITLAB_PRIVATE_TOKEN={token}

6. Initialize a sync repository from DEV

bash
iflowkit sync init --id {packageId}
cd {packageId}

This exports the DEV tenant IntegrationPackage into a Git repository and initializes .iflowkit metadata.

7. Daily sync workflows

Git → CPI

bash
iflowkit sync push

CPI → Git

bash
iflowkit sync pull

Compare with an environment branch

bash
iflowkit sync compare --to qas
iflowkit sync compare --to prd

Promote between environments

bash
iflowkit sync deliver --to qas
iflowkit sync deliver --to prd

PRD operations require explicit --to prd.

Inspect deployment records

bash
iflowkit sync deploy status --env dev

8. Logs

The CLI writes logs under:

text
{user-config-dir}/iflowkit/logs/YYYY-MM-DD.log

For more detail during troubleshooting:

bash
iflowkit --log-level debug sync push