SKILL.md
Viking Shared
When to Use
Use this skill when an external agent is setting up SearchCLI for the first time, or when it needs to check authentication, profiles, and local readiness.
Preconditions
Node.js >= 20is installed- the repository has already been cloned, or the CLI has already been installed with
scripts/install.sh
Commands
auth import-env: importVIKINGAK/VIKINGSKfrom the current shell into the local secure storeauth login: capture AK/SK interactively in a real terminalauth status: inspect the active profile, credential source, and regionauth use: switch profilesauth list: list saved profilesllm login: capture OpenAI-compatible LLM base URL, model, and API key interactively; stores the API key in the local secure storellm import-env: importVIKINGLLMBASEURL/VIKINGLLMAPIKEY/VIKINGLLMMODELinto config plus secure storellm status: inspect the active LLM provider, model, base URL, and secret source without revealing the API keyllm logout: delete the stored LLM API key for a profiledoctor: check local dependencies, auth, and configurationskill list: inspect the published Viking skillsskill install: install Viking skills from the local repository checkoutapp status/app diagnose: inspect app readiness before blaming runtime behaviorsearch run/chat run: run a minimal verification request
Regions
Built-in region checklist (for --region and auth profiles):
- Beijing:
cn-beijing - Johor:
ap-southeast-1
Workflow
- Confirm that the CLI is installed, then run
auth status - If the current shell already has
VIKINGAK/VIKINGSK, preferauth import-env - Otherwise, if the agent can keep an interactive real terminal alive, run
auth login - If interactive login is not possible, ask the user to set
VIKINGAK/VIKINGSKin the current shell and then runauth import-env - Run
doctorto verify the local environment - External agents should install Viking skills with
npx skills add "<repo-url>" -y -g - Repository maintainers can use
skill install allor install named skills from the local checkout - Before deeper debugging, use
app statusorsearch/chat runfor a minimal runtime check
LLM Setup
Search tuning query generation and LLM relevance judging need an OpenAI-compatible LLM API. Do not ask the user to paste an LLM API key into chat.
Use this priority order:
- If the current real terminal already has
VIKINGLLMBASEURL,VIKINGLLMAPIKEY, andVIKINGLLMMODEL, runvs llm import-env. - Otherwise, if the agent can keep an interactive real terminal alive, run
vs llm loginand wait for the user to enter the API key in that terminal. - If interactive login is not possible, tell the user to set
VIKINGLLMBASEURL,VIKINGLLMAPIKEY, andVIKINGLLMMODELin the current terminal, then runvs llm import-env.
The first version supports only the openai-compatible protocol. Non-secret LLM metadata is written to ~/.viking/config.json; the API key is stored through the local secure credential store.
Customer Environment Principle
- In customer environments, assume repository source code is unavailable.
- Execute tasks using only the installed skills, the packaged
vsCLI surface (--help, command output, and observed runtime behavior), and explicit user-provided information. - Do not rely on reading local repository source files, generated repo snapshots, or implementation details to decide runtime actions.
- If the installed CLI behavior conflicts with a skill, trust the installed CLI behavior first.
- If the skills and the packaged CLI still do not provide enough information to proceed safely, stop and ask the user instead of searching source code.
Constraints
- Sandbox must allow writing
~/.viking/config.json:vs auth login/vs auth import-env/vs auth use(and even some--helppaths) persist non-secret config to~/.viking/config.json. If the agent runs inside a sandbox with a read-only home directory, these commands fail withEACCES: permission denied/Not allow operate files. Before running anyvscommand that touches auth or config, ensure the sandbox grants write access to~/.viking/(or run those commands outside the sandbox). Do not misread this environment restriction as a CLI bug. - Mandatory command verification: before executing any concrete
vs ...command in this shared workflow, the agent MUST first consultvs-product-qato verify the current command surface, required flags, payload fields, input format, allowed values, and relevant command-specific constraints. This is a non-optional precondition for all shared workflow commands, including auth, doctor, LLM setup, app readiness checks, search/chat runtime checks, and skill installation. Only after that verification may the agent finalize parameters and run the command. - If the user has already placed credentials in the current shell, prefer
auth import-envand do not ask them to paste secrets into chat - If LLM credentials are needed, prefer
llm import-envorllm login; do not ask the user to paste LLM API keys into chat - Before installing or distributing a skill, confirm that the current CLI version satisfies
requires_cli - If setup, auth, doctor, or runtime checks fail and the user asks a product concept, capability, API field, console UI path, purchase, billing, or general troubleshooting question outside this shared setup workflow, temporarily hand off to
vs-product-qa; return to this workflow only after the grounded product answer is complete.