A command-line tool for importing documents from external platforms (Confluence) into the Straion platform.
- Import Confluence pages into Straion
- List pages from Confluence spaces
- Track import status
- Manage authentication credentials securely
- Get space information
- Node.js 20.x or higher
- pnpm (or npm/yarn)
- Clone the repository and navigate to the CLI directory:
cd apps/cli- Install dependencies:
pnpm install- Build the project:
pnpm build- (Optional) Link the CLI globally for development:
npm linkBefore using the CLI, you need to configure your credentials:
straion authThis will prompt you for:
- Straion API endpoint (e.g.,
http://localhost:3000) - Straion API key
- Confluence credentials (optional):
- Base URL (e.g.,
https://your-domain.atlassian.net) - API token
- Base URL (e.g.,
Configuration is stored securely in ~/.straion/config.json.
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Give it a label and copy the generated token
Configure or update your credentials:
straion authImport a specific Confluence page by its ID:
straion import --source confluence --page-id <PAGE_ID>Example:
straion import --source confluence --page-id 123456789Check the status of a previously submitted import:
straion status <IMPORT_ID>Example:
straion status abc123def456List all pages in a Confluence space:
straion list --source confluence --space-id <SPACE_ID>Example:
straion list --source confluence --space-id 98765432Get detailed information about a Confluence space:
straion space --key <SPACE_KEY>Example:
straion space --key MYSPACE| Command | Description | Options |
|---|---|---|
auth |
Configure authentication credentials | None |
import |
Import documents from external platforms | -s, --source <platform> (required)--page-id <id> (required) |
status <import-id> |
Check the status of an import | <import-id> (required) |
list |
List available documents from a source | -s, --source <platform> (required)--space-id <id> (required) |
space |
Get Confluence space information | --key <key> (required) |
src/
├── cli.ts # Main CLI entry point
├── commands/ # Command implementations
│ ├── auth.ts # Authentication configuration
│ ├── import.ts # Import command
│ ├── list.ts # List command
│ ├── space.ts # Space command
│ └── status.ts # Status command
├── integrations/ # External platform integrations
│ └── index.ts # Confluence API client
└── utils/ # Utilities
└── config.ts # Configuration management
Compile TypeScript to JavaScript:
pnpm buildRemove build artifacts:
pnpm cleanThe CLI provides helpful error messages for common issues:
- Authentication errors: Prompts you to run
straion auth - Connection errors: Checks if the Straion service is running
- Not found errors: Validates page IDs and space keys
- Configuration errors: Ensures all required credentials are set
- Credentials are stored with restricted permissions (0600) in
~/.straion/config.json - The config directory has restricted permissions (0700)
- API tokens are never logged or displayed
- Passwords are masked during input
Run straion auth to configure your credentials.
Run straion auth and select to configure Confluence integration.
Ensure the Straion import service is running:
docker-compose up -dVerify the page ID is correct and you have access to it in Confluence.
MIT