Skip to content
/ dev Public

A utility I used to create tmux sessions for my various projects.

Notifications You must be signed in to change notification settings

Zolmok/dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev

A Rust utility for creating and managing tmux or Zellij sessions for development projects.

Features

  • Automatically creates tmux or Zellij sessions with preconfigured windows
  • Attaches to existing sessions if they already exist
  • Supports custom configurations via JSON (.dev.json) or KDL (.dev.kdl) files
  • Falls back to a sensible default 4-window layout (Code, Zsh, Server, UI)
  • Generate a starter config file with --init

Installation

cargo build --release
cp target/release/dev ~/.local/bin/

Usage

Run dev from the root of your project directory:

cd ~/projects/my-app
dev

The tool checks for configuration files in this order:

  1. .dev.json - Custom tmux configuration
  2. .dev.kdl - Custom Zellij layout
  3. Default layout - Creates 4 windows (Code, Zsh, Server, UI)

Generating a Config File

To create a .dev.json starter config in the current directory:

dev --init

This generates a config with the default 4-window layout that you can customize. The session name is automatically set to the current directory name.

Configuration

JSON Configuration (tmux)

Create a .dev.json file in your project root:

{
  "session": "my-app",
  "windows": [
    {
      "name": "Build",
      "actions": ["cargo watch -x test -x build"],
      "pwd": ".",
      "select": true
    },
    {
      "name": "Code",
      "actions": [],
      "pwd": ".",
      "select": false
    },
    {
      "name": "Server",
      "actions": ["npm run dev"],
      "pwd": "./frontend",
      "select": false
    }
  ]
}

Window Properties

PropertyTypeDescription
namestringWindow name displayed in tmux
actionsstring[]Commands to execute when the window is created
pwdstringWorking directory for the window
selectbooleanIf true, this window is selected after creation

KDL Configuration (Zellij)

Create a .dev.kdl file in your project root:

layout {
    tab name="Build" {
        pane command="cargo" {
            args "watch" "-x" "test" "-x" "build"
        }
    }
    tab focus=true name="Code" {
        pane
    }
    tab name="Shell" {
        pane
    }
}

See the Zellij layout documentation for more options.

Default Layout

When no configuration file is found, the tool creates a tmux session with:

WindowNamePurpose
0CodePrimary editing window
1ZshGeneral shell tasks
2ServerRunning development server
3UIFrontend/UI tasks

The session name is derived from the current directory name.

Examples

See dev-sample.json and dev-sample.kdl for example configurations.

Dependencies

License

MIT

About

A utility I used to create tmux sessions for my various projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages