mirror of
https://github.com/coalaura/idk.git
synced 2025-09-06 11:05:16 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
532b8e1c61 | ||
![]() |
90c467ce9e | ||
f52675f69e | |||
3bd346e99c |
BIN
.github/screenshot.png
vendored
Normal file
BIN
.github/screenshot.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 350 KiB |
@@ -1,5 +1,7 @@
|
||||
# idk
|
||||
|
||||

|
||||
|
||||
Turn plain-English questions into a single, ready-to-run shell command with a short explanation. idk streams the suggestion, detects your OS/shell and common tools, and (optionally) asks if you want to execute the command.
|
||||
|
||||
- Powered by OpenRouter chat completions
|
||||
@@ -11,6 +13,12 @@ Turn plain-English questions into a single, ready-to-run shell command with a sh
|
||||
|
||||
There are prebuilt, stable releases available [here](https://github.com/coalaura/idk/releases). Alternatively you can also build idk from source.
|
||||
|
||||
You can bootstrap **idk** with a single command. This script will detect your OS and CPU (`amd64`/`arm64`), download the correct binary and install it to `/usr/local/bin/idk`.
|
||||
|
||||
```bash
|
||||
curl -sL https://src.w2k.sh/idk/install.sh | sh
|
||||
```
|
||||
|
||||
## Configure
|
||||
|
||||
On first run, idk creates a config at `~/.idk.yml` with defaults and exits so you can add your API key.
|
||||
|
52
install.sh
Normal file
52
install.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
OS=$(uname -s | tr 'A-Z' 'a-z')
|
||||
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
x86_64)
|
||||
ARCH=amd64
|
||||
;;
|
||||
aarch64|arm64)
|
||||
ARCH=arm64
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Resolving latest version..."
|
||||
|
||||
VERSION=$(curl -sL https://api.github.com/repos/coalaura/idk/releases/latest | grep -Po '"tag_name": *"\K.*?(?=")')
|
||||
|
||||
if ! printf '%s\n' "$VERSION" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||
echo "Error: '$VERSION' is not in vMAJOR.MINOR.PATCH format" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f /tmp/idk
|
||||
|
||||
BIN="idk_${VERSION}_${OS}_${ARCH}"
|
||||
URL="https://github.com/coalaura/idk/releases/download/${VERSION}/${BIN}"
|
||||
|
||||
echo "Downloading ${BIN}..."
|
||||
|
||||
if ! curl -sL "$URL" -o /tmp/idk; then
|
||||
echo "Error: failed to download $URL" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'rm -f /tmp/idk' EXIT
|
||||
|
||||
chmod +x /tmp/idk
|
||||
|
||||
echo "Installing to /usr/local/bin/idk requires sudo"
|
||||
|
||||
if ! sudo install -m755 /tmp/idk /usr/local/bin/idk; then
|
||||
echo "Error: install failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "idk $VERSION installed to /usr/local/bin/idk"
|
Reference in New Issue
Block a user