Skip to content

Commit 1b29eb7

Browse files
authored
Prettify README + setup script (#976)
1 parent 8a4afec commit 1b29eb7

File tree

5 files changed

+237
-73
lines changed

5 files changed

+237
-73
lines changed
1.56 MB
Loading

.github/media/amazon-q-logo.avif

28.8 KB
Binary file not shown.

README.md

Lines changed: 123 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,66 @@
1-
# Amazon Q Developer for command line Monorepo
21

3-
The **`amazon-q-developer-cli`** monorepo houses most of the core code for the Amazon Q Developer desktop
4-
app and CLI.
5-
6-
## Installation
7-
8-
To install Amazon Q Developer for command line see the AWS public documentation [here](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html).
9-
10-
## Overview
11-
12-
Several projects live here:
13-
14-
- [`autocomplete`](packages/autocomplete/) - The autocomplete react app
15-
- [`dashboard`](packages/dashboard/) - The dashboard react app
16-
- [`figterm`](crates/figterm/) - figterm, our headless terminal/pseudoterminal that
17-
intercepts the user’s terminal edit buffer.
18-
- [`q_cli`](crates/q_cli/) - the `q` CLI, allows users to interface with Amazon Q Developer from
19-
the command line
20-
- [`fig_desktop`](crates/fig_desktop/) - the Rust desktop app, uses
21-
[`tao`](https://docs.rs/tao/latest/tao/)/[`wry`](https://docs.rs/wry/latest/wry/)
22-
for windowing/webviews
23-
- [`fig_input_method`](crates/fig_input_method/) - The input method used to get cursor
24-
position on macOS
25-
- [`vscode`](extensions/vscode/) - Contains the VSCode plugin needed
26-
for the Amazon Q Developer for command line to work in VSCode
27-
- [`jetbrains`](extensions/jetbrains/) - Contains the VSCode plugin
28-
needed for the Amazon Q Developer for command line to work in Jetbrains IDEs
29-
30-
Other folder to be aware of
31-
32-
- [`build-scripts/`](build-scripts/) - Contains all python scripts to build,
33-
sign, and test the project on macOS and Linux
34-
- [`crates/`](crates/) - Contains all internal rust crates
35-
- [`packages/`](packages/) - Contains all internal npm packages
36-
- [`proto/`](proto/) -
37-
[protocol buffer](https://developers.google.com/protocol-buffers/) message
38-
specification for inter-process communication
39-
- [`tests/`](tests/) - Contain integration tests for the projects
40-
41-
Below is a high level architecture of how the different components of the app and
42-
their IPC:
43-
44-
![architecture](docs/assets/architecture.svg)
45-
46-
## Setup
2+
<p align="center">
3+
<a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html">
4+
<picture>
5+
<img src="./.github/media/amazon-q-logo.avif" alt="Amazon Q"
6+
width="200px"
7+
>
8+
</picture>
9+
</a>
10+
</p>
11+
12+
<h4 align="center">
13+
Amazon Q CLI brings IDE-style autocomplete and agentic capabilities to your terminal.
14+
</h4>
15+
16+
17+
<div align="center">
18+
<a href="https://github.com/aws/amazon-q-developer-cli/graphs/commit-activity"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/aws/amazon-q-developer-cli"/></a>
19+
<a href="https://github.com/aws/amazon-q-developer-cli/issues"><img alt="GitHub open issues" src="https://img.shields.io/github/issues/aws/amazon-q-developer-cli"/></a>
20+
</div>
21+
22+
23+
<div align="center">
24+
25+
[![Rust Test](https://github.com/aws/amazon-q-developer-cli/actions/workflows/rust.yml/badge.svg)](https://github.com/aws/amazon-q-developer-cli/actions/workflows/rust.yml)
26+
[![Typos Test](https://github.com/aws/amazon-q-developer-cli/actions/workflows/typos.yml/badge.svg)](https://github.com/aws/amazon-q-developer-cli/actions/workflows/typos.yml)
27+
[![Typescript Test](https://github.com/aws/amazon-q-developer-cli/actions/workflows/typescript.yml/badge.svg)](https://github.com/aws/amazon-q-developer-cli/actions/workflows/typescript.yml)
28+
</div>
29+
30+
<p align="center">
31+
<a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html">
32+
<picture>
33+
<img src="./.github/media/amazon-q-cli-features.jpeg" alt="Amazon Q CLI Features"
34+
>
35+
</picture>
36+
</a>
37+
</p>
38+
39+
## 😍 Features
40+
- 🔮 [**Auto Completion**](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-autocomplete.html): IDE-style completions to hundreds of popular CLIs like `git`, `npm`, `docker`, and `aws`.
41+
- 💬 [**Natural Language Chat**](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat.html): Interact with your terminal using natural language to ask questions, debug issues, or explore the codebase.
42+
- 🧠 [**Contextual Awareness**](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat.html#command-line-chat-context-integration): Integrates context from your local development environment, so answers are tailored to your specific code and setup.
43+
- 🤖 [**Agentic Execution**](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-autocomplete.html): Let Amazon Q take action: generate code, edit files, automate Git workflows, resolve merge conflicts, and more — with your permission.
44+
45+
## ⚡️ Installation
46+
47+
- **macOS**:
48+
- **DMG**: Download from AWS:
49+
[aws.amazon.com](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-getting-started-installing.html)
50+
- **Homebrew**: `brew install amazon-q`
51+
- **Linux**:
52+
- [Ubuntu/Debian](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html#command-line-installing-ubuntu)
53+
- [AppImage](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html#command-line-installing-appimage)
54+
- [Alternative Linux builds](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html#command-line-installing-alternative-linux)
55+
- **Windows**:
56+
- Follow the discussions for
57+
[Windows](https://github.com/aws/q-command-line-discussions/discussions/15)
58+
- Or [use it on Window with WSL](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html#command-line-installing-windows)
59+
- **Remote machines**
60+
- [Autocomplete in SSH](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-autocomplete-ssh.html)
61+
62+
63+
## 🚀 Start Contributing
4764

4865
### Prerequisites
4966

@@ -57,39 +74,26 @@ their IPC:
5774
git clone https://github.com/aws/amazon-q-for-command-line.git
5875
```
5976

60-
### 2. Install platform dependencies
61-
62-
This is all the dep
63-
64-
For Debian/Ubuntu:
65-
77+
### 2. Setup
78+
Hassle-free setup:
6679
```shell
67-
sudo apt update
68-
sudo apt install build-essential pkg-config jq dpkg curl wget cmake clang libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev valac libibus-1.0-dev libglib2.0-dev sqlite3 libxdo-dev protobuf-compiler
80+
npm run setup
6981
```
7082

71-
For Arch:
72-
73-
```shell
74-
sudo pacman -Syu
75-
sudo pacman -S --needed webkit2gtk base-devel curl wget openssl appmenu-gtk-module gtk3 libappindicator-gtk3 librsvg libvips cmake jq pkgconf
76-
```
83+
Or if you'd like to DIY:
7784

78-
For Fedora:
85+
<details>
86+
<summary>Manual Setup</summary>
87+
<div>
7988

80-
```shell
81-
sudo dnf check-update
82-
sudo dnf install webkit2gtk3-devel.x86_64 openssl-devel curl wget libappindicator-gtk3 librsvg2-devel jq
83-
sudo dnf group install "C Development Tools and Libraries"
84-
```
89+
### 1. Install platform dependencies
8590

86-
For MacOS:
91+
For Debian/Ubuntu:
8792

8893
```shell
89-
xcode-select --install
90-
brew install mise pnpm protobuf zsh bash fish shellcheck jq
94+
sudo apt update
95+
sudo apt install build-essential pkg-config jq dpkg curl wget cmake clang libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev valac libibus-1.0-dev libglib2.0-dev sqlite3 libxdo-dev protobuf-compiler
9196
```
92-
9397
### 2. Install Rust toolchain using [Rustup](https://rustup.rs):
9498

9599
```shell
@@ -145,7 +149,13 @@ Run `pnpm` in root directory to add pre-commit hooks:
145149
pnpm install --ignore-scripts
146150
```
147151

148-
## 💡 Quick Tip for Onboarding
152+
</div>
153+
</details>
154+
155+
156+
157+
158+
### 💡 Quick Tip for Onboarding
149159

150160
Use Q CLI to help you onboard Q CLI!
151161

@@ -172,11 +182,52 @@ This enables Q to answer onboarding questions like:
172182
Great for speeding up your ramp-up and navigating the repo more effectively.
173183

174184

175-
## Security
185+
186+
187+
## 🏗️ Project Layout
188+
189+
Several projects live here:
190+
191+
- [`autocomplete`](packages/autocomplete/) - The autocomplete react app
192+
- [`dashboard`](packages/dashboard/) - The dashboard react app
193+
- [`figterm`](crates/figterm/) - figterm, our headless terminal/pseudoterminal that
194+
intercepts the user’s terminal edit buffer.
195+
- [`q_cli`](crates/q_cli/) - the `q` CLI, allows users to interface with Amazon Q Developer from
196+
the command line
197+
- [`fig_desktop`](crates/fig_desktop/) - the Rust desktop app, uses
198+
[`tao`](https://docs.rs/tao/latest/tao/)/[`wry`](https://docs.rs/wry/latest/wry/)
199+
for windowing/webviews
200+
- [`fig_input_method`](crates/fig_input_method/) - The input method used to get cursor
201+
position on macOS
202+
- [`vscode`](extensions/vscode/) - Contains the VSCode plugin needed
203+
for the Amazon Q Developer for command line to work in VSCode
204+
- [`jetbrains`](extensions/jetbrains/) - Contains the VSCode plugin
205+
needed for the Amazon Q Developer for command line to work in Jetbrains IDEs
206+
207+
Other folder to be aware of
208+
209+
- [`build-scripts/`](build-scripts/) - Contains all python scripts to build,
210+
sign, and test the project on macOS and Linux
211+
- [`crates/`](crates/) - Contains all internal rust crates
212+
- [`packages/`](packages/) - Contains all internal npm packages
213+
- [`proto/`](proto/) -
214+
[protocol buffer](https://developers.google.com/protocol-buffers/) message
215+
specification for inter-process communication
216+
- [`tests/`](tests/) - Contain integration tests for the projects
217+
218+
Below is a high level architecture of how the different components of the app and
219+
their IPC:
220+
221+
![architecture](docs/assets/architecture.svg)
222+
223+
224+
225+
226+
## 🛡️ Security
176227

177228
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
178229

179-
## Licensing
230+
## 📜 Licensing
180231

181232
This repo is dual licensed under MIT and Apache 2.0 licenses.
182233

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"preview:dashboard": "pnpm -C packages/dashboard preview",
2626
"clean": "turbo clean --parallel",
2727
"prepare": "husky",
28-
"precommit": "lint-staged --config .lintstagedrc.mjs"
28+
"precommit": "lint-staged --config .lintstagedrc.mjs",
29+
"setup": "bash scripts/setup.sh"
2930
},
3031
"devDependencies": {
3132
"@vitest/coverage-v8": "^3.0.8",

scripts/setup.sh

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
OS="$(uname -s)"
6+
7+
install_linux_deps() {
8+
if [ -f /etc/debian_version ]; then
9+
echo "Detected Debian/Ubuntu"
10+
sudo apt update
11+
sudo apt install build-essential pkg-config jq dpkg curl wget cmake clang libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libdbus-1-dev libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev valac libibus-1.0-dev libglib2.0-dev sqlite3 libxdo-dev protobuf-compiler
12+
elif [ -f /etc/arch-release ]; then
13+
echo "Detected Arch"
14+
sudo pacman -Syu --noconfirm
15+
sudo pacman -S --noconfirm --needed webkit2gtk base-devel curl wget openssl appmenu-gtk-module gtk3 libappindicator-gtk3 librsvg libvips cmake jq pkgconf
16+
elif [ -f /etc/fedora-release ]; then
17+
echo "Detected Fedora"
18+
sudo dnf check-update
19+
sudo dnf install -y webkit2gtk3-devel.x86_64 openssl-devel curl wget libappindicator-gtk3 librsvg2-devel jq
20+
sudo dnf group install -y "C Development Tools and Libraries"
21+
else
22+
echo "Unsupported Linux distribution. Check the docs for manual installation instructions."
23+
exit 1
24+
fi
25+
}
26+
27+
install_macos_deps() {
28+
echo "Detected macOS"
29+
xcode-select --install || true
30+
brew install mise pnpm protobuf zsh bash fish shellcheck jq
31+
}
32+
33+
install_rust() {
34+
echo "Installing Rust toolchain..."
35+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
36+
# Detect shell and source the correct env file
37+
38+
SHELL_NAME=$(basename "$SHELL")
39+
case "$SHELL_NAME" in
40+
fish)
41+
source "$HOME/.cargo/env.fish"
42+
;;
43+
nu)
44+
source "$HOME/.cargo/env.nu"
45+
;;
46+
*)
47+
. "$HOME/.cargo/env"
48+
;;
49+
esac
50+
51+
rustup default stable
52+
rustup toolchain install nightly
53+
cargo install typos-cli
54+
55+
if [[ "$OS" == "Darwin" ]]; then
56+
rustup target add x86_64-apple-darwin
57+
rustup target add aarch64-apple-darwin
58+
fi
59+
}
60+
add_mise_to_shell() {
61+
echo "Adding mise integration to shell..."
62+
63+
SHELL_NAME=$(basename "$SHELL")
64+
65+
case "$SHELL_NAME" in
66+
zsh)
67+
ZSHRC="${ZDOTDIR:-$HOME}/.zshrc"
68+
grep -qxF 'eval "$(mise activate zsh)"' "$ZSHRC" || echo 'eval "$(mise activate zsh)"' >> "$ZSHRC"
69+
;;
70+
bash)
71+
BASHRC="$HOME/.bashrc"
72+
grep -qxF 'eval "$(mise activate bash)"' "$BASHRC" || echo 'eval "$(mise activate bash)"' >> "$BASHRC"
73+
;;
74+
fish)
75+
FISH_CONFIG="$HOME/.config/fish/config.fish"
76+
mkdir -p "$(dirname "$FISH_CONFIG")"
77+
grep -qxF 'mise activate fish | source' "$FISH_CONFIG" || echo 'mise activate fish | source' >> "$FISH_CONFIG"
78+
;;
79+
*)
80+
echo "⚠️ Unknown shell '$SHELL_NAME'. Please add mise manually to your shell config."
81+
;;
82+
esac
83+
}
84+
85+
setup_mise() {
86+
echo "Installing Python and Node with mise..."
87+
add_mise_to_shell
88+
mise trust
89+
mise install
90+
}
91+
92+
setup_precommit() {
93+
echo "Installing pre-commit hooks..."
94+
pnpm install --ignore-scripts
95+
}
96+
97+
echo "Setting up project dependencies..."
98+
99+
if [[ "$OS" == "Linux" ]]; then
100+
install_linux_deps
101+
elif [[ "$OS" == "Darwin" ]]; then
102+
install_macos_deps
103+
else
104+
echo "Unsupported OS: $OS"
105+
exit 1
106+
fi
107+
108+
install_rust
109+
setup_mise
110+
setup_precommit
111+
112+
echo "✅ Setup complete! Follow the instructions in the README to get started."

0 commit comments

Comments
 (0)