bug
This commit is contained in:
@@ -12,38 +12,42 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
- `flate2` — gzip compression, paired with `tar`
|
||||
- `age` — encryption/decryption using SSH keys (RSA or Ed25519) loaded from disk
|
||||
- `clap` — command line argument parsing (derive API), used for subcommands and flags
|
||||
- `ssh-key` — generating new Ed25519 SSH keys
|
||||
- `rand` — `OsRng` entropy source for key generation
|
||||
|
||||
`drawer` is a command line tool for managing projects.
|
||||
|
||||
A drawer is a single directory with related files in for a project. Drawer files always end
|
||||
in the `.drawer` extension, like `foo.drawer`. To create a drawer file from a directory, we
|
||||
first tar all files in the directory, and then encrypt the resulting tarball. To open a drawer
|
||||
file, we decrypt it and expand the tarball to a directory.
|
||||
A drawer is a single directory with related files for a project. Drawer files always end
|
||||
in the `.drawer` extension, like `foo.drawer`. To create a drawer file from a directory,
|
||||
the contents are tarred, gzip-compressed, and encrypted in memory before being written to disk.
|
||||
To open a drawer file, it is decrypted and the tarball is expanded into a directory.
|
||||
|
||||
The `drawer` tool has two subcommands, `drawer open` and `drawer close`. Each of these commands
|
||||
requires a key, the path to which can be given by either the `$DRAWER_KEY` environment variable
|
||||
or a `-i` command line parameter.
|
||||
The `drawer` tool has three subcommands. `open` and `close` require a key (an SSH private key),
|
||||
the path to which can be given by either the `$DRAWER_KEY` environment variable or `-i`.
|
||||
|
||||
### Open subcommand
|
||||
### open
|
||||
|
||||
The `drawer open` subcommand will decrypt and untar a drawer file into a path. It takes two arguments,
|
||||
the name of a drawer file (required) and a path to expand it into (optional, defaults to a directory
|
||||
under the current directory named the same as the drawer file). If the target path exists and is not
|
||||
empty, print an error message, unless the `-f` flag is passed.
|
||||
Decrypt and expand a drawer file into a directory. Takes a drawer file (required) and a target
|
||||
path (optional, defaults to a directory named after the drawer file stem). Prints a message when
|
||||
the target path is inferred. Fails if the target exists and is non-empty, unless `-f` is passed.
|
||||
|
||||
### Close subcommand
|
||||
### close
|
||||
|
||||
The `drawer close` subcommand will create a drawer file from a directory and a key. The command
|
||||
takes two arguments, the name of a drawer file (required) and the path to a directory (optional,
|
||||
defaults to the current directory). If the target drawer file is inside the directory, print an
|
||||
error message saying so. Otherwise, create a tarball (in memory) of the directory contents, encrypt
|
||||
them (again in memory), and write the drawer file to disk.
|
||||
Compress and encrypt a directory into a drawer file. Takes a drawer file (required) and a source
|
||||
directory (optional, defaults to the directory named after the drawer file stem). Prints a message
|
||||
when the source path is inferred. Fails if the drawer file would be written inside the source directory.
|
||||
|
||||
### key
|
||||
|
||||
Generate a new Ed25519 SSH key and write it to a file. Takes a filename (required). Fails if the
|
||||
file already exists or the parent directory does not exist.
|
||||
|
||||
### Examples:
|
||||
|
||||
- `drawer close -i ~/.keys/mykey ~/Documents/blah.drawer ~/Documents/blah` (create a file, `~/Documents/blah.drawer`,
|
||||
encrypted with `~/.keys/mykey`, containing the contents of `~/Documents/blah`)
|
||||
- `drawer open ~/Documents/blah.drawer` (open `~/Documents/blah.drawer` into `./blah` using a key found at `$DRAWER_KEY`)
|
||||
- `drawer close -i ~/.keys/mykey ~/Documents/blah.drawer ~/Documents/blah` — create `~/Documents/blah.drawer` from `~/Documents/blah`
|
||||
- `drawer close -i ~/.keys/mykey ~/Documents/blah.drawer` — same, inferring source directory from drawer name
|
||||
- `drawer open ~/Documents/blah.drawer` — open into `./blah` using `$DRAWER_KEY`
|
||||
- `drawer key ~/.keys/mykey` — generate a new SSH key at `~/.keys/mykey`
|
||||
|
||||
## Implementation plan
|
||||
|
||||
|
||||
Reference in New Issue
Block a user