### laio start Examples Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Provides various examples of starting laio sessions, including auto-detection, specific configurations, using variables, custom files, and skipping commands or attachments. ```bash # Start with auto-detection laio start ``` ```bash # Start specific config laio start myproject ``` ```bash # Start with variables laio start template --var project=frontend --var env=dev ``` ```bash # Start with array variables for multiple services laio start microservices \ --var services=auth \ --var services=api \ --var services=frontend ``` ```bash # Start from custom file laio start --file /path/to/config.yaml ``` ```bash # Start without startup commands laio start myproject --skip-cmds ``` ```bash # Start without attaching laio start myproject --skip-attach ``` ```bash # Force picker (ignore .laio.yaml) laio start -p ``` -------------------------------- ### laio start Template Variables Examples Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Demonstrates how to pass single, multiple, and array variables to the 'laio start' command for use in configuration templates. ```bash # Single variable laio start myconfig --var project_name=webapp ``` ```bash # Multiple variables laio start myconfig --var name=myapp --var env=dev ``` ```bash # Array variables (repeat same key) laio start myconfig --var service=api --var service=web --var service=worker ``` -------------------------------- ### laio start YAML Configuration Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Illustrates how to use auto-injected and user-provided template variables within a YAML configuration file using Tera syntax. ```yaml name: {{ session_name }} # Always available path: {{ path }} # Defaults to cwd env: PROJECT: {{ project_name }} # User-provided variable ``` -------------------------------- ### Example Bash Command for Basic Template Variables Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Shows how to start a laio session and provide values for template variables using the `--var` flag. ```bash laio start myconfig --var project_name=webapp --var editor=vim ``` -------------------------------- ### Create and Start a Laio Session Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Demonstrates creating a new Laio configuration and starting a tmux session with it. Assumes Laio CLI is installed. ```bash laio config create myproject laio start myproject ``` -------------------------------- ### Team Setup with Local Config Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Maintainer creates and commits `.laio.yaml`, while team members clone and run `laio start` to use it. ```bash # Maintainer: laio config create git add .laio.yaml git commit -m "Add laio configuration" # Team members: git clone cd laio start ``` -------------------------------- ### Install laio using Homebrew Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Install laio using Homebrew by tapping the repository and then installing the package. ```bash brew tap ck3mp3r/laio-cli https://github.com/ck3mp3r/laio-cli/ brew install laio ``` -------------------------------- ### Install laio CLI with Homebrew Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/installing.md Tap the laio-cli repository and then install the laio CLI using Homebrew. ```bash brew tap ck3mp3r/laio-cli https://github.com/ck3mp3r/laio-cli/ brew install laio ``` -------------------------------- ### laio start Options Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Options for the 'laio start' command, including specifying configuration files, multiplexers, template variables, and controlling startup behavior. ```bash -f, --file Use specific configuration file ``` ```bash -m, --muxer Multiplexer to use (tmux or zellij) ``` ```bash -p, --show-picker Show config picker (skip .laio.yaml) ``` ```bash --skip-cmds Skip startup commands/scripts ``` ```bash --skip-attach Start session without attaching ``` ```bash --var Template variable (repeatable) ``` -------------------------------- ### Start Laio Session with Template Variables Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Demonstrates starting a Laio session and overriding template variables. Useful for dynamic configurations. ```bash # Uses session name and cwd automatically laio start myproject # Override path laio start myproject --var path=~/projects/myproject # Multiple services (array variables) laio start microservices \ --var services=auth \ --var services=api \ --var services=frontend ``` -------------------------------- ### laio start Usage Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Starts a new session from a configuration. You can specify a configuration name, use a specific file, or pass template variables. ```bash laio start [OPTIONS] [NAME] ``` -------------------------------- ### Example Bash Command for Template Variable Defaults Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Illustrates starting a laio session with default values for optional variables, and overriding specific variables. ```bash # Uses defaults for optional variables laio start myconfig # Overrides the shell variable laio start myconfig --var shell=/bin/bash ``` -------------------------------- ### Example: Full Lifecycle Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/lifecycle.md Define startup and shutdown commands/scripts, and configure session windows. Ensure scripts are idempotent and include timeouts for robustness. ```yaml name: api-development path: ~/projects/my-api startup: - command: docker-compose args: [up, -d, postgres, redis] startup_script: | #!/usr/bin/env bash set -e echo "Waiting for database..." timeout 30 bash -c 'until docker-compose exec -T postgres pg_isready; do sleep 1; done' echo "Running migrations..." npm run db:migrate echo "Seeding test data..." npm run db:seed echo "API environment ready!" shutdown: - command: docker-compose args: [stop] shutdown_script: | #!/usr/bin/env bash echo "Backing up logs..." cp logs/app.log logs/app.log.$(date +%Y%m%d-%H%M%S) echo "Stopping containers..." docker-compose down echo "Session ended." windows: - name: api panes: - commands: - command: npm args: [run, dev] ``` -------------------------------- ### Complete YAML Configuration Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md A comprehensive example demonstrating the structure of a laio-cli YAML configuration file, including session settings, environment variables, startup/shutdown commands, and multi-level window/pane definitions. ```yaml name: fullstack-app path: ~/projects/my-app shell: /bin/zsh # Optional: Add delay for Nushell compatibility # pane_cmd_delay: 500 env: NODE_ENV: development API_URL: http://localhost:8000 startup: - command: docker-compose args: [up, -d, postgres] startup_script: | #!/usr/bin/env bash sleep 2 npm run db:migrate shutdown: - command: docker-compose args: [down] windows: - name: editor panes: - name: nvim focus: true commands: - command: $EDITOR - name: dev flex_direction: row # vertical split: side-by-side panes: - flex: 2 flex_direction: column # horizontal split: stacked panes: - flex: 3 path: ./backend commands: - command: npm args: [run, dev] - flex: 1 commands: - command: npm args: [run, test:watch] - flex: 1 path: ./frontend commands: - command: npm args: [run, dev] - name: logs panes: - zoom: true style: bg=black,fg=green script: | #!/usr/bin/env bash docker-compose logs -f ``` -------------------------------- ### Launch Multi-Service Stack Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Start a multi-service development environment by invoking `laio start microservices` and passing multiple `--var services` arguments. ```bash laio start microservices \ --var services=auth \ --var services=api \ --var services=frontend \ --var services=worker ``` -------------------------------- ### Start Session with Local Config Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md When `laio start` is run without arguments, it automatically searches for and uses a `.laio.yaml` file in the current or parent directories. ```bash laio start ``` -------------------------------- ### Create Project Configurations from Template Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Use the `laio start template` command with `--var` flags to specify project-specific variables and generate configurations. ```bash laio start template --var project=frontend --var main_file=src/App.tsx laio start template --var project=backend --var main_file=main.rs --var env=staging ``` -------------------------------- ### Laio YAML Configuration with Template Variables Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Example of a Laio YAML configuration file demonstrating the use of Tera template variables for dynamic session setup. ```yaml name: {{ session_name }} path: {{ path }} windows: {% for service in services %} - name: {{ service }} panes: - path: ./{{ service }} commands: - command: npm args: [run, dev] {% endfor %} ``` -------------------------------- ### Install laio CLI with Nix Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/installing.md Use this command to install the laio CLI using the Nix package manager. ```bash nix profile install "github:ck3mp3r/laio-cli" ``` -------------------------------- ### Create a Local Project Config Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Create a '.laio.yaml' file in the current directory using 'laio config create'. This enables 'laio start' without arguments. ```bash cd ~/projects/myapp # Create a local config and open in $EDITOR laio config create # Auto-detects .laio.yaml in current (or parent) directory laio start ``` -------------------------------- ### Environment Setup Script Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/lifecycle.md A script to load environment variables from a local file and initialize development tools like direnv. ```yaml startup_script: | #!/usr/bin/env bash # Load environment secrets if [ -f .env.local ]; then export $(cat .env.local | xargs) fi # Initialize tools direnv allow echo "Environment ready!" ``` -------------------------------- ### Project Template Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Example of a `.laio.yaml` template file that can be copied to new projects and customized. ```yaml # .laio.yaml template name: CHANGEME path: . windows: - name: editor panes: - command: $EDITOR - name: dev panes: - flex: 1 - flex: 1 ``` -------------------------------- ### Create and Start a laio Session Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/quick-start.md Use these commands to create a new laio configuration and start a session. This sets up a default environment with an editor and a split terminal. ```bash # Create a new configuration laio config create myproject # Start the session laio start myproject ``` -------------------------------- ### laio start Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Starts a new session from a configuration. It can auto-detect configurations, use specific files, accept template variables, and control attachment and command execution. ```APIDOC ## laio start ### Description Start a new session from a configuration. ### Usage ```bash laio start [OPTIONS] [NAME] ``` ### Arguments `[NAME]` - Name of the configuration (optional) - If omitted, shows configuration picker - If `.laio.yaml` exists, uses it automatically - Use `-p` to skip local config and show picker ### Options ``` -f, --file Use specific configuration file -m, --muxer Multiplexer to use (tmux or zellij) -p, --show-picker Show config picker (skip .laio.yaml) --skip-cmds Skip startup commands/scripts --skip-attach Start session without attaching --var Template variable (repeatable) ``` ### Template Variables Pass variables to your configuration templates using `--var`: ```bash # Single variable laio start myconfig --var project_name=webapp # Multiple variables laio start myconfig --var name=myapp --var env=dev # Array variables (repeat same key) laio start myconfig --var service=api --var service=web --var service=worker ``` **Auto-injected variables:** - `session_name` - Always set to the session name (first argument) - `path` - Defaults to current working directory (override with `--var path=...`) Variables can be used in your YAML configuration with Tera syntax: ```yaml name: {{ session_name }} # Always available path: {{ path }} # Defaults to cwd env: PROJECT: {{ project_name }} # User-provided variable ``` ### Examples ```bash # Start with auto-detection laio start # Start specific config laio start myproject # Start with variables laio start template --var project=frontend --var env=dev # Start with array variables for multiple services laio start microservices \ --var services=auth \ --var services=api \ --var services=frontend # Start from custom file laio start --file /path/to/config.yaml # Start without startup commands laio start myproject --skip-cmds # Start without attaching laio start myproject --skip-attach # Force picker (ignore .laio.yaml) laio start -p ``` ``` -------------------------------- ### laio stop Template Variables Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Shows how to use template variables with 'laio stop' to manage sessions that were started with variables. ```bash # Start session with variables laio start myconfig --var env=dev --var region=us-east # Stop session using same variables laio stop myconfig --var env=dev --var region=us-east ``` -------------------------------- ### Start a laio tmux session Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Commands to start a tmux session using laio. Supports starting from named configs, specific files, interactive picking, skipping commands, and passing template variables. ```bash # Start from a named config (~/.config/laio/myproject.yaml) laio start myproject ``` ```bash # Start from a specific YAML file laio start --file ./custom-layout.yaml ``` ```bash # Start with an interactive picker laio start --picker ``` ```bash # Skip startup lifecycle commands laio start myproject --skip-cmds ``` ```bash # Start without attaching (useful in scripts) laio start myproject --skip-attach ``` ```bash # Pass template variables laio start myproject --var path=~/projects/myproject --var env=staging ``` ```bash # Pass array variables (repeated --var with the same key) laio start microservices \ --var services=auth \ --var services=api \ --var services=frontend ``` ```bash # Use a specific multiplexer (experimental Zellij support) laio start myproject --muxer zellij ``` -------------------------------- ### Start Application Workspace Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Starts a tmux workspace defined by the laio configuration for a specific application. This command can be run from anywhere once the configuration is linked. ```bash laio start myapp ``` -------------------------------- ### Start a Specific Laio Session Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/session-export.md Launch a Laio session using a previously exported YAML configuration file. This command is used to switch between different environment setups. ```bash laio start dev laio start debug laio start present ``` -------------------------------- ### Laio YAML Configuration with Lifecycle Hooks and Environment Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Example Laio YAML configuration defining session name, path, startup/shutdown commands and scripts, and environment variables. ```yaml name: myproject path: /path/to/myproject # Session lifecycle hooks startup: - command: docker-compose args: [up, -d] startup_script: | #!/usr/bin/env bash echo "Session starting..." shutdown: - command: docker-compose args: [down] shutdown_script: | #!/usr/bin/env bash echo "Cleaning up..." # Session environment shell: /bin/zsh env: NODE_ENV: development DEBUG: "app:*" ``` -------------------------------- ### Start a laio Session Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/your-first-session.md Initiates the laio session using the specified configuration file. You will be automatically attached to the session with the defined layout. ```bash laio start myproject ``` -------------------------------- ### Validate Example Template (Specific Values) Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Validate the example template by providing specific values for its variables using the `--var` flag. This allows testing different configurations. ```bash laio config validate mytemplate --var env=production ``` -------------------------------- ### Flex Sizing Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/layouts.md The `flex` property defines proportional sizing for panes. Higher values indicate larger proportions. ```yaml panes: - flex: 1 # Takes 1 part - flex: 2 # Takes 2 parts (twice as large) - flex: 1 # Takes 1 part # Result: 25% | 50% | 25% ``` -------------------------------- ### Validate Example Template (Default) Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Validate the example template using default values for its variables. This command checks if the template renders correctly without requiring any `--var` arguments. ```bash laio config validate mytemplate # Uses default for env ``` -------------------------------- ### Monorepo Root Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Example of a `.laio.yaml` file placed at the root of a monorepo to manage sessions for different packages. ```yaml name: monorepo path: . windows: - name: api panes: - path: ./packages/api commands: - command: npm args: [run, dev] - name: web panes: - path: ./packages/web commands: - command: npm args: [run, dev] - name: mobile panes: - path: ./packages/mobile commands: - command: npm args: [run, start] ``` -------------------------------- ### Laio CLI Command Reference Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Provides a quick reference for common Laio CLI commands, including starting, stopping, listing sessions, and managing configurations. ```bash laio start [name] # Start session (interactive picker if name omitted) laio start --file config.yaml # Start from specific file laio start --var key=value # Start with template variables laio stop [name] # Stop session laio stop --all # Stop all laio-managed sessions laio list # List sessions and configs laio config create # Create new config laio config create --var key=value # Create from _default.yaml with variables laio config create --copy src # Create from existing config laio config edit # Edit config in $EDITOR laio config link # Symlink .laio.yaml to global config laio session yaml # Export current tmux session to YAML laio completion # Generate shell completions ``` -------------------------------- ### Build Laio CLI from Source Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Builds the Laio CLI project in release mode using Cargo. Requires Rust and Cargo to be installed. ```bash cargo build --release ``` -------------------------------- ### Tera Filter Examples Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Illustrates common Tera filters for string manipulation and default value assignment within laio configuration templates. ```bash # Tera filter examples (used inside {{ }}): # {{ name | upper }} # {{ name | lower }} # {{ path | replace(from="~", to="/home/user") }} # {{ value | default(value="fallback") }} ``` -------------------------------- ### Create laio.yaml Configuration File Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Use the `laio config create` command to generate a `.laio.yaml` file in the current project directory. This file will be automatically detected and used by `laio start`. ```bash cd myproject laio config create ``` -------------------------------- ### Create Interactive Tmux Session for Export Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/session-export.md This example shows how to create a named tmux session with a specific working directory and then split it into multiple panes, setting their working directories as well. This is a precursor to exporting the session layout. ```bash tmux new -s myapp -c ~/projects/myapp mux split-window -h -c ~/projects/myapp mux split-window -v -c ~/projects/myapp mux select-pane -t 0 mux split-window -v -c ~/projects/myapp # Run various commands in panes ``` -------------------------------- ### Example Bash Command for Array Variables Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Demonstrates how to pass multiple values for an array variable using the `--var` flag in the command line. ```bash laio start multi-env --var environments=dev --var environments=staging --var environments=prod ``` -------------------------------- ### Create Git Worktree Sessions Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Launch git worktree sessions using the `laio start worktree` command, providing repository and branch variables. ```bash laio start worktree --var repo=myproject --var branch=feature-auth laio start worktree --var repo=myproject --var branch=bugfix-login ``` -------------------------------- ### Nested Layouts Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/layouts.md Panes can contain nested panes with their own `flex_direction` to create complex layouts. Be mindful of nesting depth. ```yaml windows: - name: dev flex_direction: row # Vertical split: side-by-side panes: - flex: 2 flex_direction: column # Horizontal split: stacked panes: - flex: 3 # 75% of left side - flex: 1 # 25% of left side - flex: 1 # Right side: single pane ``` -------------------------------- ### VS Code Schema Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Example `settings.json` configuration for VS Code to enable schema validation and autocompletion for `.laio.yaml` files using the laio CLI's schema. ```json { "yaml.schemas": { "/path/to/laio-cli/src/common/config/schema.json": "*.laio.yaml" } } ``` -------------------------------- ### Inline Script Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Use the `script` field to define an inline script that runs after all commands in a pane have completed. Ensure the script includes a shebang. ```yaml script: | #!/usr/bin/env bash tail -f app.log ``` -------------------------------- ### laio stop Examples Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Illustrates various ways to stop laio sessions, including specific sessions, templated sessions, skipping commands, and stopping all or other sessions. ```bash # Stop specific session (non-templated) laio stop myproject ``` ```bash # Stop session started with template variables laio stop template --var project=frontend --var env=dev ``` ```bash # Stop without shutdown commands laio stop myproject --skip-cmds ``` ```bash # Stop all laio sessions laio stop --all ``` ```bash # Stop all except current laio stop --others ``` -------------------------------- ### Use Custom Config Directory Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Override the default laio configuration directory using the '--config-dir' flag for commands like 'start' and 'list'. ```bash # Use a custom config directory laio --config-dir ~/work/laio-configs start myproject laio --config-dir ~/personal/laio list ``` -------------------------------- ### laio list Usage and Examples Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Lists active and available sessions or configurations. Supports table format by default and JSON output with the --json flag. An alias 'ls' is also available. ```bash laio list [OPTIONS] ``` ```bash # List all (table format) laio list ``` ```bash # List with JSON output laio list --json ``` ```bash # Using alias laio ls ``` -------------------------------- ### Test Exported Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/session-export.md Commands to stop an existing tmux session and then start a new one using the generated Laio configuration file. ```bash tmux kill-session -t experiment # Stop the original laio start experiment # Test the config ``` -------------------------------- ### Launch with Scalar and Array Variables Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Launch laio with scalar and array variables using the '--var' flag. This example demonstrates passing multiple services and boolean flags. ```bash # Launch with scalar and array variables laio start microservices \ --var services=auth \ --var services=api \ --var services=frontend \ --var env=staging \ --var debug=true ``` -------------------------------- ### Example Validatable Template Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md A sample YAML configuration template designed for validation. It uses default values for optional variables like `env` to ensure it can be validated without explicit `--var` flags. ```yaml name: {{ session_name }} path: {{ path }} env: NODE_ENV: {{ env | default(value="development") }} windows: - name: main panes: - flex: 1 ``` -------------------------------- ### Multi-Service Development Configuration Template Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Dynamically generate configurations for multiple microservices using a loop to define windows and panes for each service. This template is useful for starting complex development stacks. ```yaml name: {{ session_name }} path: {{ path }} windows: {% for service in services %} - name: {{ service }} flex_direction: column panes: - flex: 3 path: ./{{ service }} commands: - command: npm args: [run, dev] - flex: 1 path: ./{{ service }} commands: - command: npm args: [run, test:watch] {% endfor %} ``` -------------------------------- ### List Configurations Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md List all available configurations. Supports JSON output and multiplexer filtering. ```bash # List all configs laio config list ``` ```bash # List with JSON output laio config list --json ``` ```bash # Using alias laio config ls ``` -------------------------------- ### Create Local .laio.yaml Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Create a local `.laio.yaml` configuration file in the current directory. ```bash # Create local .laio.yaml laio config create ``` -------------------------------- ### List All Configurations Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Lists all available config files in `~/.config/laio/`, merged with currently active sessions, showing status icons. ```bash laio config list laio config ls # alias laio config list --json ``` -------------------------------- ### Define Startup Commands Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/lifecycle.md Specify commands to run before a session is created. Commands execute sequentially. ```yaml startup: - command: docker-compose args: - up - -d - command: npm args: - run - db:migrate ``` -------------------------------- ### Create Configuration from Template Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Create a new configuration by copying an existing template configuration. ```bash # Create from template laio config create newproject --copy template ``` -------------------------------- ### Create Configuration with Template Variables Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Create a configuration and provide custom variables that will be rendered in the `_default.yaml` template. Variables can be repeated. ```bash # Create config with custom variables laio config create myproject --var env=production --var region=us-east ``` ```bash # Create with template variables laio config create myproject --var env=production --var db=postgres ``` ```bash # Create local .laio.yaml with variables laio config create --var env=dev ``` -------------------------------- ### Define Startup and Shutdown Scripts Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Use 'startup_script' for inline bash scripts to run after initial commands, and 'shutdown_script' for cleanup after session termination. Ensure scripts have a shebang. ```yaml #!/usr/bin/env bash set -e echo "Waiting for database..." timeout 30 bash -c 'until docker-compose exec -T postgres pg_isready; do sleep 1; done' npm run db:migrate echo "Environment ready!" ``` ```yaml #!/usr/bin/env bash cp logs/app.log "logs/app.log.$(date +%Y%m%d-%H%M%S)" docker-compose down echo "Session ended." ``` -------------------------------- ### Row Flex Direction Example Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/layouts.md Use `flex_direction: row` for a vertical split, placing panes side-by-side. This is the default behavior. ```yaml windows: - name: example flex_direction: row # vertical split, panes side-by-side panes: - flex: 1 - flex: 1 ``` -------------------------------- ### Create Configuration by Copying Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Creates a new configuration by copying an existing one, updating the session name. This is useful for creating similar configurations. ```bash laio config create newproject --copy existingproject ``` -------------------------------- ### Validate Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Validates a laio configuration file to catch syntax errors, missing fields, or type mismatches before starting a session. ```bash laio config validate myproject ``` ```bash laio config validate --file .laio.yaml ``` -------------------------------- ### Create Template Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Creates a default configuration named 'template' and opens it for editing. This template can then be used to create new projects. ```bash laio config create template laio config edit template ``` -------------------------------- ### Pane Zoom Control Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/layouts.md Start a pane in a zoomed state by setting `zoom: true`. This hides all other panes until zoom is toggled manually. ```yaml panes: - flex: 1 - flex: 2 zoom: true # Starts zoomed, hiding other panes commands: - command: tail -f logs/app.log ``` -------------------------------- ### Pane Focus Control Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/layouts.md Set `focus: true` on a pane to make it the active pane when the session starts. Only one pane should have focus. ```yaml panes: - flex: 1 commands: - command: npm run build - flex: 2 focus: true # Cursor starts here commands: - command: npm run dev ``` -------------------------------- ### Session Startup Script Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Specify an inline script to be executed after initial startup commands but before panes are created. Requires a shebang. ```yaml startup_script: | #!/usr/bin/env bash echo "Session starting..." ``` -------------------------------- ### Share Configuration via Version Control Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Demonstrates how to add a local `.laio.yaml` configuration to version control for team sharing. Team members can then pull and use it. ```bash # In your project laio config create git add .laio.yaml git commit -m "Add laio configuration" git push ``` -------------------------------- ### Validate laio Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/your-first-session.md Checks the syntax and schema compliance of your session configuration file before starting the session. This helps catch errors early. ```bash laio config validate myproject ``` -------------------------------- ### Create Local Config Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Use this command to create a new `.laio.yaml` file in the current directory. You can also copy from an existing template. ```bash cd ~/projects/myapp laio config create ``` ```bash laio config create --copy template ``` -------------------------------- ### Configure Window and Pane Layouts Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Define multi-window layouts with nested panes using 'flex_direction' for row/column stacking and 'flex' for proportional sizing. Specify commands and working directories for each pane. ```yaml name: editor path: ./src # flex_direction: row # default; "row" = side-by-side, "column" = stacked panes: - name: nvim focus: true # cursor starts here (boolean, only one per window) commands: - command: $EDITOR # supports env var expansion ``` ```yaml name: dev flex_direction: row # panes are placed side by side panes: - flex: 2 # proportional width: 2/3 of the window flex_direction: column # nested panes stacked vertically panes: - flex: 3 # 3/4 of the left column path: ./backend commands: - command: npm args: [run, dev] - flex: 1 # 1/4 of the left column commands: - command: npm args: [run, test:watch] - flex: 1 # 1/3 of the window path: ./frontend commands: - command: npm args: [run, dev] ``` ```yaml name: logs panes: - zoom: true # start pane zoomed (boolean, only one per window) style: bg=black,fg=green # tmux pane styling (string, comma-separated key=value) script: | #!/usr/bin/env bash docker-compose logs -f app ``` -------------------------------- ### Define Startup Script Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/lifecycle.md Provide a script to execute after all startup commands have completed. This script blocks session creation until it finishes. ```yaml startup_script: | #!/usr/bin/env bash echo "Initializing session..." sleep 2 curl http://localhost:8000/health ``` -------------------------------- ### List All Configurations Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Lists all laio configurations, indicating active sessions with an asterisk. ```bash laio config list ``` -------------------------------- ### Enter Laio Development Environment with Nix Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Enters a Nix-managed development environment for Laio CLI. Useful for consistent builds and dependency management. ```bash nix develop # or use direnv direnv allow ``` -------------------------------- ### Create Local Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Creates a `.laio.yaml` configuration file in the current directory. Refer to Local Configs documentation for more details. ```bash laio config create ``` -------------------------------- ### List Configurations in JSON Format Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Lists all laio configurations in JSON format, which is useful for scripting and automation. ```bash laio config list --json ``` -------------------------------- ### Build laio from source Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Build the laio CLI from source using Cargo. Requires Rust 1.70+ and tmux 3.0+. ```bash git clone https://github.com/ck3mp3r/laio-cli cd laio-cli cargo build --release # binary: target/release/laio ``` -------------------------------- ### YAML Configuration Schema Reference Source: https://context7.com/ck3mp3r/laio-cli/llms.txt A laio YAML configuration declares the session name, root path, optional lifecycle hooks, environment variables, and the window/pane tree. All fields with their types, defaults, and constraints are shown in the complete example below. ```yaml # ~/.config/laio/fullstack-app.yaml # Required: name (min 3 chars), path, windows (min 1) name: fullstack-app # tmux session name (string, required, min 3 chars) path: ~/projects/my-app # root working directory (string, required) shell: /bin/zsh # override default shell (string, optional) pane_cmd_delay: 500 # ms delay before sending pane commands; use 500 for Nushell (number, optional, default: 0) env: # session-wide environment variables (object, optional) NODE_ENV: development API_URL: http://localhost:8000 DEBUG: "app:*" ``` -------------------------------- ### Tera Template Syntax - Loops Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Demonstrates how to use a `for` loop in Tera templates to iterate over a list and generate dynamic configuration entries. ```yaml {% for item in items %} - name: {{ item }} {% endfor %} ``` -------------------------------- ### Link Multiple Local Configs in Workspace Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md In a multi-project workspace, link each project's `.laio.yaml` to make them globally accessible by name. ```bash cd ~/projects/api && laio config link api cd ~/projects/web && laio config link web cd ~/projects/mobile && laio config link mobile ``` -------------------------------- ### Link Local Configuration Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Creates a symbolic link from the global configuration directory to a local `.laio.yaml` file in the current project directory. ```bash cd ~/projects/myapp laio config link myapp ``` -------------------------------- ### Build Interactive Tmux Layout Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/session-export.md This sequence of commands demonstrates how to create a multi-pane tmux session interactively. It's the first step before exporting the layout. ```bash tmux new -s experiment # Create windows, split panes, run commands # Adjust layout until satisfied ``` -------------------------------- ### Backup Configurations Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Provides commands to back up all laio configurations or a single configuration file. ```bash # Backup all configs cp -r ~/.config/laio ~/backups/laio-$(date +%Y%m%d) # Backup single config cp ~/.config/laio/myproject.yaml ~/backups/ ``` -------------------------------- ### Full Command Format with Arguments Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Specify commands with arguments using the full format. Each argument should be a separate item in the `args` array. ```yaml commands: - command: npm args: - run - dev - --port - "3000" ``` -------------------------------- ### Validate a Template Before Use Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Use 'laio config validate' to check the syntax and structure of a template before deploying it, optionally with specific variables. ```bash # Validate a template before use laio config validate microservices \ --var services=auth \ --var services=api ``` -------------------------------- ### Define Window and Pane Layouts with YAML Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Use this YAML structure to define multi-window and multi-pane layouts. Configure split directions, proportional sizing, initial focus, and zoom states for panes. ```yaml windows: - name: editor panes: - name: nvim commands: - command: $EDITOR - name: dev flex_direction: row # vertical split (panes side-by-side) panes: - flex: 2 flex_direction: column # horizontal split (panes stacked) panes: - flex: 3 path: ./src focus: true # initial focus commands: - command: npm args: [run, dev] - flex: 1 zoom: true # start zoomed script: | #!/usr/bin/env bash tail -f logs/app.log - flex: 1 style: bg=blue,fg=white # tmux pane styling ``` -------------------------------- ### Add Local Config to Git Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Add your `.laio.yaml` file to Git version control to track changes and share it with your team. ```bash git add .laio.yaml git commit -m "Add laio session configuration" ``` -------------------------------- ### Link Custom Configuration File Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Link a specific configuration file with a custom name using the `--file` flag. ```bash laio config link myapp --file custom-config.yaml ``` -------------------------------- ### List Available laio Sessions Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/quick-start.md Run this command to view all existing laio sessions and configurations. Active sessions are indicated with an asterisk. ```bash laio list ``` -------------------------------- ### Link Local Config to Global Namespace Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Creates a symlink from a local project config file into `~/.config/laio/`, making it accessible by name from anywhere without duplicating the file. ```bash # Link .laio.yaml -> ~/.config/laio/myproject.yaml laio config link myproject ``` ```bash # Link a custom file instead of .laio.yaml laio config link myproject --file ./configs/dev.yaml ``` -------------------------------- ### Link Project Configuration Locally Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Links a local project configuration to the laio global configuration. This makes the project's laio configuration accessible globally by its name. ```bash laio config link myapp ``` -------------------------------- ### Use Specific Configuration File Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Specify a particular configuration file to use with the `--file` flag, overriding automatic detection. ```bash laio start --file /path/to/other-config.yaml ``` -------------------------------- ### Project-Specific Configuration Template Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Define a generic project template with variables for project name, environment, and main file. Use this template to create configurations for different projects. ```yaml name: {{ project }} path: ~/projects/{{ project }} env: PROJECT_NAME: {{ project }} ENV: {{ env | default(value="development") }} windows: - name: editor panes: - commands: - command: $EDITOR args: [{{ main_file | default(value="README.md") }}] ``` -------------------------------- ### Create Multiple Environment Configurations Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/session-export.md Generate distinct Laio session YAML files for different development contexts, such as development, debugging, and presentation. This allows for easy switching between tailored environments. ```bash # Development layout laio session yaml > ~/.config/laio/dev.yaml # Switch to debugging layout tmux kill-session -t dev # ... set up debugging session ... laio session yaml > ~/.config/laio/debug.yaml # Switch to presentation layout # ... set up clean layout ... laio session yaml > ~/.config/laio/present.yaml ``` -------------------------------- ### List laio sessions and configs Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Commands to list active laio-managed tmux sessions and available configurations. Supports table and JSON output formats. ```bash # List as table laio list # ╭──────────────╮ # │ * myproject │ # │ backend │ # │ frontend │ # ╰──────────────╯ ``` ```bash # List as JSON laio list --json # [ # { "name": "myproject", "status": "active" }, # { "name": "backend", "status": "inactive" }, # { "name": "frontend", "status": "inactive" } # ] ``` -------------------------------- ### laio config create Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Creates a new laio configuration. If no name is provided, it creates a `.laio.yaml` file in the current directory. ```APIDOC ## laio config create ### Description Create a new configuration. #### Usage ```bash laio config create [OPTIONS] [NAME] ``` #### Arguments `[NAME]` - Name of the configuration (optional) - If omitted, creates `.laio.yaml` in current directory ``` -------------------------------- ### Simple Command Format Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/yaml-reference.md Define commands without arguments using the simple format. This is useful for executing basic commands. ```yaml commands: - command: nvim ``` -------------------------------- ### Create a laio configuration Source: https://context7.com/ck3mp3r/laio-cli/llms.txt Commands to create new laio YAML configuration files. Supports creating named global configs, local configs, copying existing configs, and pre-filling template variables. ```bash # Create a named global config and open in $EDITOR laio config create myproject ``` ```bash # Create a local .laio.yaml in the current directory laio config create ``` ```bash # Copy from an existing config laio config create newproject --copy myproject ``` ```bash # Create from _default.yaml with pre-filled template variables laio config create webapp --var editor=nvim --var env=development ``` -------------------------------- ### laio config create Usage Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Creates a new laio configuration. If no name is provided, it creates a `.laio.yaml` file in the current directory. ```bash laio config create [OPTIONS] [NAME] ``` -------------------------------- ### Directly Edit Configuration File Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Manually opens the laio configuration file using the `$EDITOR` environment variable. ```bash $EDITOR ~/.config/laio/myproject.yaml ``` -------------------------------- ### Basic laio Session YAML Structure Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/getting-started/your-first-session.md Defines a laio session named 'myproject' with a root path. It includes two windows: 'editor' with a single pane running nvim, and 'terminal' with two side-by-side panes. ```yaml name: myproject path: /path/to/myproject windows: - name: editor panes: - commands: - command: nvim - name: terminal flex_direction: row # vertical split: side-by-side panes: - flex: 1 - flex: 1 ``` -------------------------------- ### Skip Local Config and Force Picker Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Use the `-p` flag to skip automatic local configuration detection and force the display of the configuration picker. ```bash laio start -p ``` -------------------------------- ### laio list Options Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Options for the 'laio list' command to specify the multiplexer and output format. ```bash -m, --muxer Multiplexer to use (tmux or zellij) ``` ```bash -j, --json Output as JSON ``` -------------------------------- ### Gitignore Local Overrides Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Configure your `.gitignore` file to exclude environment-specific customizations like `.laio.local.yaml` while keeping the main configuration. ```gitignore # Keep the main config !.laio.yaml # Ignore local overrides (if you create them) .laio.local.yaml ``` -------------------------------- ### Skip Lifecycle Hooks via CLI Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/configuration/lifecycle.md Use command-line flags to bypass startup or shutdown hooks during session operations. ```bash laio start myproject --skip-cmds ``` ```bash laio stop myproject --skip-cmds ``` -------------------------------- ### Run Laio CLI Tests Source: https://github.com/ck3mp3r/laio-cli/blob/main/README.md Executes the test suite for the Laio CLI project using Cargo. ```bash cargo test ``` -------------------------------- ### Basic Session Export to Stdout Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/session-export.md Use this command to output the current tmux session structure to standard output. ```bash laio session yaml ``` -------------------------------- ### laio list Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/reference/cli-commands.md Lists active and available sessions or configurations. Supports table format and JSON output. ```APIDOC ## laio list ### Description List active and available sessions/configurations. ### Usage ```bash laio list [OPTIONS] ``` Alias: `laio ls` ### Options ``` -m, --muxer Multiplexer to use (tmux or zellij) -j, --json Output as JSON ``` ### Examples ```bash # List all (table format) laio list # List with JSON output laio list --json # Using alias laio ls ``` ### Output Active sessions are marked with `*`. ``` -------------------------------- ### Edit Configuration in Editor Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Opens the specified laio configuration file in your default editor for direct editing. ```bash laio config edit myproject ``` -------------------------------- ### Personal Overrides for Local Config Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/local-configs.md Team members can create personal override files (e.g., `.laio.local.yaml`) for custom preferences, which are not committed to version control. ```bash cp .laio.yaml .laio.local.yaml # Edit .laio.local.yaml for personal preferences laio start --file .laio.local.yaml ``` -------------------------------- ### Delete Configuration with Confirmation Source: https://github.com/ck3mp3r/laio-cli/blob/main/docs/content/docs/workflow/managing-configs.md Deletes a laio configuration file after prompting for confirmation. ```bash laio config delete myproject ```