squirrel_tools

Crates.iosquirrel_tools
lib.rssquirrel_tools
version0.1.0-pre5
created_at2026-01-06 00:17:09.360675+00
updated_at2026-01-08 17:28:30.809237+00
descriptionA CLI tool for archiving files with date-based organization
homepagehttps://github.com/yourusername/squirrel_tools
repositoryhttps://github.com/yourusername/squirrel_tools
max_upload_size
id2024852
size366,688
Adam Ladachowski (aladac)

documentation

https://github.com/yourusername/squirrel_tools#readme

README

Squirrel Tools

A fast CLI tool for archiving files, managing dotfiles, and organizing executables.

$ sq document.pdf --compress gz

  Squirrel Archive
  --------------------------------------------------
  File:          document.pdf (2.4 MB)
  Destination:   ~/.nuts/pdf/2026/01/06/
  Compression:   gz

  ✓ Compressed (2.4 MB -> 892 KB, 63% reduction)
  ✓ Archived to ~/.nuts/pdf/2026/01/06/document.pdf.gz

  Done in 0.3s

Features

  • Fast - Native Rust, ~5ms startup
  • Single Binary - No runtime dependencies
  • Archive - Date-based file organization with compression
  • Dotfiles - Symlink-based dotfile management
  • Bin - Executable management with PATH integration
  • Git Integration - Auto-commits for archive, dotfiles, and bin
  • Shell Completions - bash, zsh, fish, elvish, powershell

Installation

git clone https://github.com/aladac/squirrel
cd squirrel
cargo install --path .

Commands

Archive

sq <file>                      # Archive file (shorthand)
sq archive add <file>          # Archive file (explicit)
sq archive get <file>          # Restore from archive (alias: restore)
sq archive list                # List archived files (alias: ls)
sq archive search <pattern>    # Search archives (alias: find)
sq archive stats               # Show statistics
sq archive clean               # Clean old files

Options for add:

Flag Description
-c, --copy Copy instead of moving
-f, --force Overwrite existing files
-e, --epoch Prefix with epoch timestamp
-z, --compress <FMT> Compression: gz, bz2, zip
--git Create git commit
--git-rm Commit removal from source repo

Dotfiles

sq dotfiles <file>             # Add dotfile (shorthand)
sq rc <file>                   # Add dotfile (alias)
sq dotfiles add <file>         # Add dotfile (explicit)
sq dotfiles rm <file>          # Remove from management
sq dotfiles list               # List managed dotfiles

Options:

Flag Description
-r, --repo Dotfiles repo path (default: ~/.nuts/dotfiles)
-f, --force Overwrite if exists
--no-commit Skip git commit

Bin (Executables)

sq bin <file>                  # Add executable (shorthand)
sq exe <file>                  # Add executable (alias)
sq bin add <file> [name]       # Add with optional rename
sq bin rm <name>               # Remove executable
sq bin list                    # List executables (alias: ls)

Options for add:

Flag Description
-f, --force Overwrite existing files
-l, --link Also create symlink in /usr/local/bin (sudo)
-d, --dir Bin directory (default: ~/.nuts/bin)
--no-commit Skip git commit

Options for rm:

Flag Description
-l, --link Also remove symlink from /usr/local/bin (sudo)
-c, --copy <PATH> Copy executable to path before removing
-m, --move-to <PATH> Move executable to path (requires --confirm)
--confirm Confirm move operation
--no-commit Skip git commit

Features:

  • Automatically makes files executable if not already
  • Creates ~/.nuts/bin directory and commits if not present
  • Warns if ~/.nuts/bin is not in PATH with shell-specific examples

Other Commands

sq init                        # Initialize ~/.nuts with git
sq configure                   # Configure settings
sq git-config                  # Git integration settings
sq completions <shell>         # Generate shell completions

Shell Completions

# Zsh
sq completions zsh > ~/.zfunc/_sq

# Bash
sq completions bash > /etc/bash_completion.d/sq

# Fish
sq completions fish > ~/.config/fish/completions/sq.fish

Configuration

Config stored at ~/.nuts/config.toml:

base_path = "~/.nuts/archive"
date_pattern = "%Y/%m/%d"
organize_by_type = true

[git]
enabled = false
template = "Archived {filename} to {destination}"

[github]
user = ""
repo = "nuts"

Directory Structure

~/.nuts/
├── archive/
│   ├── pdf/2026/01/08/
│   │   └── document.pdf
│   └── txt/2026/01/08/
│       └── notes.txt
├── bin/
│   ├── my-script
│   └── another-tool
├── dotfiles/
│   ├── .bashrc
│   ├── .config/
│   │   └── nvim/
│   └── _root/
│       └── etc/my-config
└── config.toml

Development

just build               # Build
just test                # Test
just release             # Release build
just install             # Install
just bump                # Bump pre-release version
just bump patch          # Bump patch version
just bump minor          # Bump minor version

License

MIT

Commit count: 0

cargo fmt