Skip to content

Instantly share code, notes, and snippets.

@intellectronica
Last active December 10, 2025 15:11
Show Gist options
  • Select an option

  • Save intellectronica/2b6d1e54a7b3567094e80551e43bb631 to your computer and use it in GitHub Desktop.

Select an option

Save intellectronica/2b6d1e54a7b3567094e80551e43bb631 to your computer and use it in GitHub Desktop.
Global Copilot CLI Just Recipes for Quick AI in the Terminal

Global Copilot CLI Just Recipes for Quick AI in the Terminal

Copilot CLI is a nice CLI agent supporting many of the best models (with a Copilot subscription). One thing I like to use it for, is giving me easy access to AI in a plain terminal.

The snippet above is from my global ~/.justfile. I also have alias j=just in my .zshrc

Each invocation streams the output to the terminal and also copies it to the clipboard.

For example:

$ j ai show me how to extract the audio from myvideo.avi into myaduio.mp3 using ffmpeg

I alias ai to cp-haiku - it's a great default for most simple tasks - fast and smart enough (and only costs 0.33X premium requests).

$ j cp-gemini update ./index.html to dark mode
$ j cp-codex give me a thorough code review of the files in this directory and save it as review.md

Happy Commandlining!

🫶 Eleanor (@intellectronica)

set shell := ["zsh", "-c"]
# AI on CLI
cp model +prompt:
@cd {{invocation_directory()}} && copilot --model {{model}} --allow-all-paths --allow-all-tools --log-level none --stream on -p "{{prompt}}" 2>/dev/null | tee >(pbcopy)
cp-gemini +prompt:
@cd {{invocation_directory()}} && just cp gemini-3-pro-preview "{{prompt}}"
cp-gpt +prompt:
@cd {{invocation_directory()}} && just cp gpt-5.1 "{{prompt}}"
cp-codex +prompt:
@cd {{invocation_directory()}} && just cp gpt-5.1-codex "{{prompt}}"
cp-sonnet +prompt:
@cd {{invocation_directory()}} && just cp claude-sonnet-4.5 "{{prompt}}"
cp-haiku +prompt:
@cd {{invocation_directory()}} && just cp claude-haiku-4.5 "{{prompt}}"
alias ai := cp-haiku
@daveio
Copy link

daveio commented Dec 10, 2025

@intellectronica This is great work! I've made some tweaks, which started with adapting it for fish but went a bit further in the end.

https://gist.github.com/daveio/6e8d0edd82b575ff105329050bbefabe

Feel free to nick any of it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment