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 🙏

© 2026 – Pkg Stats / Ryan Hefner

codestate-cli

v1.5.1

Published

CodeState CLI - Configuration, Script, and Git Management

Readme

CodeState CLI

A powerful command-line interface for CodeState - a developer context engine for saving and resuming your full development environment.

Visit codestate.dev for more information about CodeState.

Version 1.4.6 Updates

What's New

  • Enhanced Functionality: Improved CLI commands and interface consistency
  • Better Integration: Updated to work with core package v1.4.5
  • Build Improvements: Enhanced build system and dependency management
  • Package Updates: Updated to v1.4.5 with improved stability

Changes from v1.4.2

  • 🔧 Core Integration: Updated to use codestate-core v1.4.5
  • 🏗️ Build Improvements: Enhanced build system with better dependency resolution
  • 📦 Package Updates: Updated to v1.4.5 with improved functionality

Overview

CodeState CLI provides a comprehensive command-line interface for managing your development context, including scripts, sessions, configurations, and git operations. It features both traditional CLI commands and an interactive TUI (Text User Interface) for enhanced user experience.

Features

🚀 Script Management

  • Create Scripts: Define reusable development scripts
  • Update Scripts: Modify existing scripts with ease
  • Delete Scripts: Remove scripts by ID or root path
  • List Scripts: View all scripts or filter by project
  • Import/Export: Share scripts across environments

💾 Session Management

  • Save Sessions: Capture your current development state
  • Resume Sessions: Restore previous development contexts
  • List Sessions: View all saved sessions
  • Update Sessions: Modify session metadata
  • Delete Sessions: Clean up old sessions

⚙️ Configuration Management

  • Show Config: Display current configuration
  • Update Config: Modify settings interactively
  • Export Config: Backup your configuration
  • Import Config: Restore configuration from backup
  • Reset Config: Restore default settings

🔧 Git Integration

  • Git Status: Check repository state
  • Stash Management: Create, list, and apply stashes
  • Commit Changes: Stage and commit modifications
  • Dirty Data: Track uncommitted changes

🎯 IDE Integration

  • Multi-IDE Support: Works with VS Code, WebStorm, and more
  • Open Projects: Launch projects in your preferred IDE
  • File Management: Open specific files in IDE

🖥️ Terminal Collections

  • Create Terminal Collections: Group related terminal commands
  • Execute Collections: Run multiple commands in sequence
  • List Collections: View all terminal collections
  • Manage Collections: Update and delete collections

Installation

npm install -g codestate-cli

Quick Start

# Initialize CodeState in your project
codestate config show

# Create your first script
codestate scripts create

# Save your current development session
codestate session save

# List all your scripts
codestate scripts show

Command Reference

Scripts Commands

# Create a new script
codestate scripts create

# Show all scripts
codestate scripts show

# Show scripts for specific project
codestate scripts show --root-path /path/to/project

# Update a script
codestate scripts update <script-id>

# Delete a script
codestate scripts delete <script-id>

# Delete all scripts for a project
codestate scripts delete-by-root-path /path/to/project

# Export scripts to file
codestate scripts export --output scripts.json

# Import scripts from file
codestate scripts import --input scripts.json

Session Commands

# Save current session
codestate session save

# List all sessions
codestate session list

# Resume a session
codestate session resume <session-id>

# Update session metadata
codestate session update <session-id>

# Delete a session
codestate session delete <session-id>

Configuration Commands

# Show current configuration
codestate config show

# Update configuration
codestate config update

# Export configuration
codestate config export --output config.json

# Import configuration
codestate config import --input config.json

# Reset to defaults
codestate config reset

Terminal Collection Commands

# List all terminal collections
codestate terminals list

# Get details of a specific collection
codestate terminals get <collection-name>

# Execute a terminal collection
codestate terminals execute <collection-name>

Interactive Mode

CodeState CLI includes an interactive TUI for enhanced user experience:

# Launch interactive mode for scripts
codestate scripts

# Launch interactive mode for sessions
codestate session

# Launch interactive mode for configuration
codestate config

# Launch interactive mode for terminal collections
codestate terminals

Examples

Creating a Development Script

codestate scripts create
# Follow the prompts to create a script:
# - Name: setup-project
# - Content: npm install && npm run build
# - Root Path: /path/to/your/project

Saving a Development Session

# Save current state including open files, git status, and scripts
codestate session save
# Enter session name: feature-development
# Session saved with ID: abc123

Resuming a Session

# List available sessions
codestate session list

# Resume a specific session
codestate session resume abc123
# This will restore your development environment

Managing Configuration

# View current settings
codestate config show

# Update settings interactively
codestate config update
# Follow prompts to modify configuration

Working with Terminal Collections

# List all terminal collections
codestate terminals list

# Execute a collection of commands
codestate terminals execute setup-project
# This will run all commands in the collection sequentially

Configuration

CodeState CLI uses a configuration file to store settings. The default location is:

  • Windows: %APPDATA%/codestate/config.json
  • macOS: ~/Library/Application Support/codestate/config.json
  • Linux: ~/.config/codestate/config.json

Configuration Options

{
  "defaultIDE": "vscode",
  "scriptsDirectory": "~/.codestate/scripts",
  "sessionsDirectory": "~/.codestate/sessions",
  "gitAutoCommit": false,
  "sessionAutoSave": true
}

Integration with IDEs

CodeState CLI integrates with popular IDEs:

  • VS Code: Open projects and files directly
    • Install the CodeState IDE Extension for seamless IDE integration - manage scripts, sessions, and configurations directly from VS Code
  • WebStorm/IntelliJ: Launch projects in JetBrains IDEs
  • Sublime Text: Open files in Sublime
  • Vim/Neovim: Open files in terminal editors

Tip: You can use both the CLI and IDE extension for most tasks. However, for saving sessions, we recommend using the IDE extension as it can capture file contents and open files, while the CLI can only save metadata. The CLI is great for terminal workflows and automation, while the IDE extension provides a native VS Code experience for managing your development context.

Development

This package is part of the CodeState monorepo. For development setup, see the main CodeState repository.

Building from Source

# Clone the repository
git clone https://github.com/codestate-cs/code-state-library.git
cd code-state-library

# Install dependencies
npm install

# Build CLI package
npm run build:cli

# Run in development mode
npm run dev

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

MIT