Skip to content

Add ckp sync alias command#84

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/add-ckp-sync-alias-command
Draft

Add ckp sync alias command#84
Copilot wants to merge 2 commits into
masterfrom
copilot/add-ckp-sync-alias-command

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 10, 2026

Adds ckp sync alias — a new subcommand that exports stored code aliases to a shell-sourceable file and wires it into the user's rc file automatically.

This pull request does...

Why ?
Stored code entries support an alias field, but there was no way to materialize those aliases into the shell environment. This command bridges that gap.

How ?

  • Adds cmd/sync.go — parent sync command (follows existing add/list pattern)
  • Adds cmd/sync_alias.go — reads all Code entries with a non-empty Alias from the store, writes them to ~/.ckp/ckp_aliases as standard shell aliases, then appends a source line to the first rc file found (.zshrc.bashrc.bash_profile). Idempotent: duplicate source lines are not added.
  • Adds AliasesFileName constant and GetAliasesFilePath() to internal/config/config.go
  • Registers sync under the root ckp command

Generated ~/.ckp/ckp_aliases format:

## File generated by ckp. DO NOT EDIT
alias ll='ls -la'
alias greet='echo "hello"'

Appended to rc file (once):

# ckp aliases
source /home/user/.ckp/ckp_aliases

Steps to verify:

  1. Add a code entry with an alias: ckp add code 'ls -la' --alias ll --comment "long listing"
  2. Run ckp sync alias
  3. Verify ~/.ckp/ckp_aliases contains alias ll='ls -la'
  4. Verify your rc file (.zshrc/.bashrc) has a source ~/.ckp/ckp_aliases line appended
  5. Run again — confirm the source line is not duplicated

** Screenshots (optional)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/elhmn/ckp/releases
    • Triggering command: /tmp/go-build2333104087/b282/cmd.test /tmp/go-build2333104087/b282/cmd.test -test.testlogfile=/tmp/go-build2333104087/b282/testlog.txt -test.paniconexit0 -test.timeout=10m0s rev-�� Pe7xFpvvQ (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add ckp sync alias command</issue_title>
<issue_description>The ckp sync alias command will add your alias in a ~/.ckp/ckp_aliases file and reference them in your main rc file</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: elhmn <5704817+elhmn@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ckp sync alias command Add ckp sync alias command Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ckp sync alias command

2 participants