Skip to content

Commit 974b014

Browse files
committed
installer
1 parent 57ffd0f commit 974b014

File tree

3 files changed

+170
-1
lines changed

3 files changed

+170
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
<img src="img/que_demo.gif" alt="Demo" style="flex: 1" />
55

6-
Que is a CLI utility designed to act as a filter in a Unix pipeline. It ingests stdin (logs, error tracebacks, config files), sanitizes the data for security, enriches it with local system context, and queries an LLM (ChatGPT or Claude) to determine the root cause and suggest a fix.
6+
Que is a CLI utility designed to act as a filter in a Unix pipeline. It ingests stdin (logs, error tracebacks, config files), sanitizes the data for security, enriches it with local system context, and queries an LLM (ChatGPT or Claude) to determine the root cause and suggest a fix. Perfect for analyzing errors in servers and CI/CD environments where you don't have easy access to AI-powered editors.
77

88
## 🔒 Privacy & Security
99

@@ -91,6 +91,43 @@ cat log.txt | que --no-context
9191
cat server.log | que --provider claude -i
9292
```
9393

94+
### CI/CD and Server Use Cases
95+
96+
Que is perfect for automated environments where you need AI-powered log analysis without interactive editors:
97+
98+
**GitHub Actions:**
99+
```yaml
100+
- name: Analyze deployment errors
101+
if: failure()
102+
run: |
103+
cat deployment.log | que --no-context > analysis.txt
104+
cat analysis.txt
105+
```
106+
107+
**Docker/Kubernetes:**
108+
```bash
109+
# Analyze container logs
110+
kubectl logs pod-name | que --no-context
111+
112+
# Analyze Docker logs
113+
docker logs container-name 2>&1 | que
114+
```
115+
116+
**Server Monitoring:**
117+
```bash
118+
# Analyze systemd service failures
119+
journalctl -u my-service --since "1 hour ago" | que
120+
121+
# Analyze application errors from log files
122+
tail -n 1000 /var/log/app/error.log | que --provider claude
123+
```
124+
125+
**Automated Error Reporting:**
126+
```bash
127+
# Send analysis to Slack/email
128+
cat error.log | que --no-context | mail -s "Error Analysis" admin@example.com
129+
```
130+
94131
## How It Works
95132

96133
Que follows a linear pipeline architecture:

install.sh

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/bin/bash
2+
# Que installer script
3+
# Downloads and installs the latest release of Que
4+
5+
set -e
6+
7+
REPO="njenia/que"
8+
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
9+
BINARY_NAME="que"
10+
11+
# Colors for output
12+
RED='\033[0;31m'
13+
GREEN='\033[0;32m'
14+
YELLOW='\033[1;33m'
15+
NC='\033[0m' # No Color
16+
17+
# Detect OS
18+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
19+
if [[ "$OS" == "linux" ]]; then
20+
OS="linux"
21+
elif [[ "$OS" == "darwin" ]]; then
22+
OS="darwin"
23+
else
24+
echo -e "${RED}Error: Unsupported OS: $OS${NC}"
25+
exit 1
26+
fi
27+
28+
# Detect architecture
29+
ARCH=$(uname -m)
30+
case $ARCH in
31+
x86_64)
32+
ARCH="amd64"
33+
;;
34+
aarch64|arm64)
35+
ARCH="arm64"
36+
;;
37+
*)
38+
echo -e "${RED}Error: Unsupported architecture: $ARCH${NC}"
39+
exit 1
40+
;;
41+
esac
42+
43+
# Determine file extension
44+
if [[ "$OS" == "darwin" || "$OS" == "linux" ]]; then
45+
EXT="tar.gz"
46+
else
47+
EXT="zip"
48+
fi
49+
50+
# Use the /latest/download/ endpoint which automatically redirects to the latest release
51+
DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/que-${OS}-${ARCH}.${EXT}"
52+
VERSION="latest"
53+
54+
if [[ -n "$VERSION" ]]; then
55+
echo -e "${GREEN}Installing Que ${VERSION} for ${OS}/${ARCH}...${NC}"
56+
else
57+
echo -e "${GREEN}Installing Que (latest) for ${OS}/${ARCH}...${NC}"
58+
fi
59+
60+
# Create temporary directory
61+
TMP_DIR=$(mktemp -d)
62+
trap "rm -rf $TMP_DIR" EXIT
63+
64+
# Download and extract
65+
echo -e "${YELLOW}Downloading from ${DOWNLOAD_URL}...${NC}"
66+
cd "$TMP_DIR"
67+
68+
if command -v curl >/dev/null 2>&1; then
69+
HTTP_CODE=$(curl -sL -w "%{http_code}" -o "que.${EXT}" "$DOWNLOAD_URL" || echo "000")
70+
if [[ "$HTTP_CODE" != "200" ]]; then
71+
echo -e "${RED}Error: Failed to download (HTTP $HTTP_CODE)${NC}"
72+
if [[ -f "que.${EXT}" ]]; then
73+
echo -e "${YELLOW}Response:$(cat que.${EXT})${NC}"
74+
rm -f "que.${EXT}"
75+
fi
76+
exit 1
77+
fi
78+
elif command -v wget >/dev/null 2>&1; then
79+
if ! wget -q -O "que.${EXT}" "$DOWNLOAD_URL"; then
80+
echo -e "${RED}Error: Failed to download${NC}"
81+
exit 1
82+
fi
83+
else
84+
echo -e "${RED}Error: Neither curl nor wget is installed${NC}"
85+
exit 1
86+
fi
87+
88+
# Verify downloaded file size
89+
FILE_SIZE=$(stat -f%z "que.${EXT}" 2>/dev/null || stat -c%s "que.${EXT}" 2>/dev/null || echo "0")
90+
if [[ "$FILE_SIZE" -lt 1000 ]]; then
91+
echo -e "${RED}Error: Downloaded file is too small (${FILE_SIZE} bytes), likely an error page${NC}"
92+
echo -e "${YELLOW}Response:$(head -c 200 que.${EXT})${NC}"
93+
rm -f "que.${EXT}"
94+
exit 1
95+
fi
96+
97+
# Extract
98+
if [[ "$EXT" == "tar.gz" ]]; then
99+
tar -xzf "que.${EXT}"
100+
else
101+
unzip -q "que.${EXT}"
102+
fi
103+
104+
# Check if binary exists
105+
if [[ ! -f "$BINARY_NAME" ]]; then
106+
echo -e "${RED}Error: Binary not found after extraction${NC}"
107+
exit 1
108+
fi
109+
110+
# Make binary executable
111+
chmod +x "$BINARY_NAME"
112+
113+
# Install to target directory
114+
if [[ ! -w "$INSTALL_DIR" ]]; then
115+
echo -e "${YELLOW}Note: ${INSTALL_DIR} requires sudo permissions${NC}"
116+
sudo mv "$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
117+
else
118+
mv "$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
119+
fi
120+
121+
# Verify installation
122+
if command -v "$BINARY_NAME" >/dev/null 2>&1; then
123+
INSTALLED_VERSION=$("$BINARY_NAME" --version 2>&1 | head -n 1 || echo "unknown")
124+
echo -e "${GREEN}✓ Que installed successfully!${NC}"
125+
echo -e "${GREEN} Version: ${INSTALLED_VERSION}${NC}"
126+
echo -e "${GREEN} Location: $(which $BINARY_NAME)${NC}"
127+
else
128+
echo -e "${YELLOW}Warning: Que installed but not found in PATH${NC}"
129+
echo -e "${YELLOW} Installed to: ${INSTALL_DIR}/${BINARY_NAME}${NC}"
130+
echo -e "${YELLOW} Make sure ${INSTALL_DIR} is in your PATH${NC}"
131+
fi
132+

que

-14 MB
Binary file not shown.

0 commit comments

Comments
 (0)