| layout | default |
|---|---|
| title | Chapter 5: Refly CLI and Claude Code Skill Export |
| nav_order | 5 |
| parent | Refly Tutorial |
Welcome to Chapter 5: Refly CLI and Claude Code Skill Export. In this part of Refly Tutorial: Build Deterministic Agent Skills and Ship Them Across APIs and Claude Code, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.
This chapter explains how to use the CLI for deterministic workflow operations and how Refly skills connect to Claude Code contexts.
- run builder/validation/commit loops from terminal
- use structured CLI output for automation chains
- export/install skills for Claude Code-oriented workflows
- keep orchestration reproducible across environments
npm install -g @refly/cli
refly init
refly login
refly builder start --name "my-workflow"
refly builder validate
refly builder commit
refly workflow run <workflowId>refly initinstalls skill references into Claude directories- skill operations can be managed with
refly skill ...commands - exported skills can be used in Claude Code and other MCP-capable contexts
You now have a deterministic CLI path for building, validating, and exporting workflow capabilities.
Next: Chapter 6: Observability, Deployment, and Operations
The uploadState function in scripts/upload-config.js handles a key part of this chapter's functionality:
import { Client as MinioClient } from 'minio';
async function uploadState(sourceFile, targetPath) {
const minioClient = new MinioClient({
endPoint: process.env.MINIO_EXTERNAL_ENDPOINT,
port: Number.parseInt(process.env.MINIO_EXTERNAL_PORT || '443'),
useSSL: process.env.MINIO_EXTERNAL_USE_SSL === 'true',
accessKey: process.env.MINIO_EXTERNAL_ACCESS_KEY,
secretKey: process.env.MINIO_EXTERNAL_SECRET_KEY,
});
const metaData = {
'Content-Type': 'application/json',
};
await minioClient.fPutObject(process.env.MINIO_EXTERNAL_BUCKET, targetPath, sourceFile, metaData);
}
async function main() {
// upload mcp catalog
await uploadState('config/mcp-catalog.json', 'mcp-config/mcp-catalog.json');
await uploadState('config/provider-catalog.json', 'mcp-config/provider-catalog.json');
}
main();This function is important because it defines how Refly Tutorial: Build Deterministic Agent Skills and Ship Them Across APIs and Claude Code implements the patterns covered in this chapter.
The main function in scripts/upload-config.js handles a key part of this chapter's functionality:
}
async function main() {
// upload mcp catalog
await uploadState('config/mcp-catalog.json', 'mcp-config/mcp-catalog.json');
await uploadState('config/provider-catalog.json', 'mcp-config/provider-catalog.json');
}
main();This function is important because it defines how Refly Tutorial: Build Deterministic Agent Skills and Ship Them Across APIs and Claude Code implements the patterns covered in this chapter.
flowchart TD
A[uploadState]
B[main]
A --> B