npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@fractary/codex-cli

v0.3.1

Published

Command-line interface for Fractary Codex knowledge management

Downloads

174

Readme

Fractary Codex CLI

Command-line interface for Fractary Codex knowledge management system.

Installation

Global Installation

npm install -g @fractary/codex-cli

Local Development

# From repository root
npm install
cd cli
npm run build
npm link

Usage

fractary-codex [command] [options]

Commands

init - Initialize Configuration

Initialize Codex v3.0 with YAML configuration in your project.

fractary-codex init [options]

Options:
  --force    Overwrite existing configuration

Example:

fractary-codex init
# Creates .fractary/codex.yaml and .codex-cache/

fetch - Fetch Documents

Fetch documents by codex:// URI reference with intelligent caching.

fractary-codex fetch <uri> [options]

Arguments:
  uri                  Codex URI (e.g., codex://org/project/path/file.md)

Options:
  --bypass-cache       Fetch directly from storage, bypassing cache
  --ttl <seconds>      Override default TTL
  --json               Output as JSON with metadata
  --output <file>      Write content to file instead of stdout

Examples:

# Fetch with caching
fractary-codex fetch codex://myorg/myproject/README.md

# Bypass cache
fractary-codex fetch codex://myorg/myproject/README.md --bypass-cache

# JSON output with metadata
fractary-codex fetch codex://myorg/myproject/README.md --json

# Save to file
fractary-codex fetch codex://myorg/myproject/README.md --output local-README.md

cache - Cache Management

Manage the document cache with subcommands for listing, clearing, and viewing statistics.

cache list - List Cache Information

fractary-codex cache list [options]

Options:
  --json    Output as JSON

cache clear - Clear Cache Entries

fractary-codex cache clear [options]

Options:
  --all                Clear entire cache
  --pattern <glob>     Clear entries matching pattern
  --dry-run            Preview without clearing

Examples:

# Clear all cache entries
fractary-codex cache clear --all

# Clear specific pattern
fractary-codex cache clear --pattern "myorg/myproject/**"

# Preview clearing
fractary-codex cache clear --all --dry-run

cache stats - Cache Statistics

fractary-codex cache stats [options]

Options:
  --json    Output as JSON

sync - Bidirectional Synchronization

Synchronize files with codex repository.

sync project - Sync Single Project

fractary-codex sync project [project-name] [options]

Options:
  --to-codex           Sync from project to codex (one-way)
  --from-codex         Sync from codex to project (one-way)
  --bidirectional      Two-way sync (default)
  --dry-run            Preview changes without syncing
  --env <environment>  Environment branch mapping

sync org - Sync Organization

fractary-codex sync org [options]

Options:
  --to-codex           Sync from projects to codex
  --from-codex         Sync from codex to projects
  --bidirectional      Two-way sync (default)
  --dry-run            Preview changes
  --exclude <pattern>  Exclude repositories matching pattern
  --parallel <n>       Number of parallel sync operations (default: 3)

types - Type Registry Management

Manage custom artifact types for classification and caching.

types list - List All Types

fractary-codex types list [options]

Options:
  --custom-only    Show only custom types
  --builtin-only   Show only built-in types
  --json           Output as JSON

types show - Show Type Details

fractary-codex types show <type-name> [options]

Options:
  --json    Output as JSON

types add - Add Custom Type

fractary-codex types add <type-name> [options]

Options:
  --pattern <glob>        File pattern (required)
  --ttl <duration>        Cache TTL (default: 24h)
  --description <text>    Type description

Example:

fractary-codex types add api-schema --pattern "**/*.openapi.{yaml,json}" --ttl 48h --description "OpenAPI schemas"

types remove - Remove Custom Type

fractary-codex types remove <type-name> [options]

Options:
  --json    Output as JSON

health - Diagnostics

Run comprehensive diagnostics on codex setup.

fractary-codex health [options]

Options:
  --json    Output as JSON for CI/CD integration

Checks:

  • Configuration validity
  • SDK client initialization
  • Cache health and statistics
  • Storage provider availability
  • Type registry status

migrate - Configuration Migration

Migrate legacy v2.x JSON configuration to v3.0 YAML format.

fractary-codex migrate [options]

Options:
  --dry-run    Preview migration without writing
  --json       Output as JSON

Configuration

Codex uses .fractary/codex.yaml for configuration:

organization: myorg
cacheDir: .codex-cache

storage:
  - type: github
    owner: myorg
    repo: codex-core
    ref: main
    token: ${GITHUB_TOKEN}
    priority: 50

  - type: local
    path: ./codex-local
    priority: 10

types:
  custom:
    api-schema:
      description: OpenAPI API schemas
      patterns:
        - "**/*.openapi.yaml"
        - "**/*.openapi.json"
      defaultTtl: 172800  # 48 hours

permissions:
  default: read
  rules:
    - pattern: "sensitive/**"
      permission: admin
      users: ["admin-user"]

sync:
  bidirectional: true
  conflictResolution: latest
  exclude:
    - "node_modules/**"
    - ".git/**"

mcp:
  enabled: true
  port: 3000

Environment Variables

  • GITHUB_TOKEN - GitHub personal access token for private repositories
  • CODEX_CACHE_DIR - Override default cache directory
  • CODEX_ORG - Override organization slug

Development

Build

npm run build

Test

npm test

Type Check

npm run typecheck

Link for Local Testing

npm link
fractary-codex --help

Architecture

The CLI is built on top of the @fractary/codex SDK and uses:

  • Commander.js for command-line parsing
  • Chalk for colored output
  • js-yaml for YAML configuration
  • Dynamic imports for fast cold-start performance

All commands use lazy-loading to avoid SDK initialization overhead for simple operations like --help.

License

MIT

Documentation

Links