A collection of Node.js tools for working with the Kaiten API (https://developers.kaiten.ru). These tools help you download cards with metadata, comments, files, and checklists, plus create spaces, boards, cards, and columns.
# Set up environment (only token is required)
export KAITEN_API_TOKEN="your-api-token"
# Download a single card by URL (no additional setup needed)
node download-card.mjs "https://company.kaiten.ru/space/123/boards/card/12345" --stdout-only
# Download card with all children recursively
node download-card.mjs "https://company.kaiten.ru/12345" --recursive --output-dir ./cardsDownloads Kaiten cards and converts them to Markdown format with metadata, comments, files, checklists, and children cards.
- π Markdown Export: Converts cards to Markdown
- β Checklist Support: Handles all checklist formats with completion status
- π File Downloads: Downloads attachments or keeps direct links
- π³ Recursive Children: Downloads entire card hierarchies
- π¬ Comments Export: Includes all card comments with metadata
- π URL Parsing: Accepts card IDs, URLs, or board card URLs
- π Metadata: Card status, type, assignee, dates, and more
# Download card by URL (recommended)
node download-card.mjs "https://company.kaiten.ru/space/123/boards/card/12345"
# Download card by ID (requires KAITEN_API_BASE_URL environment variable)
node download-card.mjs 12345
# Download with API token override
node download-card.mjs 12345 --token your-api-token
# Output to stdout instead of files
node download-card.mjs "https://company.kaiten.ru/12345" --stdout-only
# Specify output directory
node download-card.mjs 12345 --output-dir ./my-cards# Direct card ID
node download-card.mjs 12345
# Board card URL
node download-card.mjs "https://company.kaiten.ru/space/123/boards/card/12345"
# Simple URL format
node download-card.mjs "https://company.kaiten.ru/12345"# Download card with all children (creates folder structure)
node download-card.mjs "https://company.kaiten.ru/12345" --recursive --max-depth 3
# Skip file downloads, keep direct Kaiten URLs
node download-card.mjs "https://company.kaiten.ru/12345" --skip-files-download
# Combine options
node download-card.mjs "https://company.kaiten.ru/12345" --recursive --skip-files-download --output-dir ./cardsWhen downloading to files (without --stdout-only):
./data/
βββ <subdomain>/ # Kaiten instance subdomain (e.g., "company", "myorg")
βββ <card-id>/ # Card ID (e.g., "12345")
βββ card.md # Main card in Markdown format
βββ card.json # Raw JSON card data
βββ comments/ # Individual comment files (sortable by creation date)
β βββ 2025-08-22-00-21-15-156.json
β βββ 2025-08-22-00-22-10-432.json
β βββ ...
βββ files/ # Downloaded attachments (if not using --skip-files-download)
β βββ document.pdf
β βββ image.png
β βββ screenshot.png
βββ children/ # Child cards (if using --recursive)
βββ 12346/
β βββ card.md
β βββ card.json
β βββ comments/
β βββ files/
βββ 12347/
βββ card.md
βββ ...
Example output path: ./data/company/12345/ for card 12345 from company.kaiten.ru
Generated Markdown includes:
- Header: Card title as H1
- Metadata: ID, status, type, assignee, dates, priority
- Description: HTML converted to Markdown
- Checklists: All checklist items with completion status
- Children: Links to child cards (if any)
- Comments: All comments with timestamps and authors
- Files: Attachments as links/images
# Required
KAITEN_API_TOKEN=your-api-token-here
# Optional (can be inferred from card URLs)
KAITEN_API_BASE_URL=https://your-instance.kaiten.ru/api/v1
DEBUG=kaiten:* # Enable debug loggingNote: KAITEN_API_BASE_URL is only required when using card IDs directly. When providing full card URLs, the base URL is automatically extracted.
| Option | Description |
|---|---|
--stdout-only |
Output Markdown to stdout instead of files |
--output-dir <dir> |
Specify output directory (default: ./data) |
--token <token> |
API token (overrides environment variable) |
--recursive |
Download all children cards recursively |
--max-depth <n> |
Maximum recursion depth (default: 3) |
--skip-files-download |
Don't download files, use direct Kaiten URLs |
--help |
Show help message |
import { downloadCard } from './download-card.mjs';
// Basic usage
const { card, markdown, comments, children } = await downloadCard({
cardId: 12345,
token: 'your-token',
apiBase: 'https://yourcompany.kaiten.ru/api/v1'
});
// With options
const result = await downloadCard({
cardId: 12345,
token: 'your-token',
includeChildren: true,
skipFiles: true,
quiet: true // Suppress error console output
});Helper scripts for creating Kaiten resources programmatically:
# Create a new space
node create-space.mjs "My New Space"
node create-space.mjs "My New Space" space-output.json# Create a board in a space
node create-board.mjs 123 "My Board"
node create-board.mjs 123 "My Board" board-output.json# Create a card in a board
node create-card.mjs 456 "My Card Title"
node create-card.mjs 456 "My Card Title" card-output.json# Create a column in a board
node create-column.mjs 456 "New Column"
node create-column.mjs 456 "New Column" column-output.jsonAll create scripts support the same environment variables as download-card.mjs and will output the created resource data in JSON format.
# Run all tests
node test-download-card.mjs
node test-command-stream.mjs
# Tests require environment variables to be set
# Creates temporary test resources and cleans them upBuilt using the official Kaiten API documentation. Supports downloading cards with metadata, comments, files, checklists, and hierarchical relationships, plus creating spaces, boards, cards, and columns.