Skip to content

Commit 87fff16

Browse files
committed
first commit
0 parents  commit 87fff16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+22127
-0
lines changed

.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[env]
2+
TMPDIR = "target/tmp"
3+
4+
[doc]
5+
rustdoc-args = ["--test-args", "--test-run-directory", "target/tmp"]

.github/workflows/ci.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
rust: [stable, "1.75"]
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Rust toolchain
26+
uses: dtolnay/rust-action@stable
27+
with:
28+
toolchain: ${{ matrix.rust }}
29+
30+
- name: Cache cargo registry
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
~/.cargo/registry
35+
~/.cargo/git
36+
target
37+
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-cargo-${{ matrix.rust }}-
40+
41+
- name: Build
42+
run: cargo build --verbose
43+
44+
- name: Run tests
45+
run: cargo test --verbose
46+
env:
47+
SLACK_INTEGRATION_TESTS: "1"
48+
49+
- name: Build release
50+
run: cargo build --release --verbose
51+
52+
fmt:
53+
name: Rustfmt
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Install Rust toolchain
59+
uses: dtolnay/rust-action@stable
60+
with:
61+
toolchain: stable
62+
components: rustfmt
63+
64+
- name: Check formatting
65+
run: cargo fmt --all -- --check
66+
67+
clippy:
68+
name: Clippy
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Install Rust toolchain
74+
uses: dtolnay/rust-action@stable
75+
with:
76+
toolchain: stable
77+
components: clippy
78+
79+
- name: Cache cargo registry
80+
uses: actions/cache@v4
81+
with:
82+
path: |
83+
~/.cargo/registry
84+
~/.cargo/git
85+
target
86+
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
87+
restore-keys: |
88+
${{ runner.os }}-cargo-clippy-
89+
90+
- name: Run Clippy
91+
run: cargo clippy --all-targets --all-features -- -D warnings
92+
93+
docs:
94+
name: Documentation
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Install Rust toolchain
100+
uses: dtolnay/rust-action@stable
101+
with:
102+
toolchain: stable
103+
104+
- name: Check documentation
105+
run: cargo doc --no-deps --document-private-items
106+
env:
107+
RUSTDOCFLAGS: -D warnings
108+
109+
coverage:
110+
name: Coverage
111+
runs-on: ubuntu-latest
112+
steps:
113+
- uses: actions/checkout@v4
114+
115+
- name: Install Rust toolchain
116+
uses: dtolnay/rust-action@stable
117+
with:
118+
toolchain: stable
119+
components: llvm-tools-preview
120+
121+
- name: Install cargo-llvm-cov
122+
uses: taiki-e/install-action@cargo-llvm-cov
123+
124+
- name: Cache cargo registry
125+
uses: actions/cache@v4
126+
with:
127+
path: |
128+
~/.cargo/registry
129+
~/.cargo/git
130+
target
131+
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
132+
restore-keys: |
133+
${{ runner.os }}-cargo-coverage-
134+
135+
- name: Run coverage
136+
run: cargo llvm-cov --all-features --workspace --fail-under 80
137+
env:
138+
SLACK_INTEGRATION_TESTS: "1"

.github/workflows/release.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.target }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- target: x86_64-unknown-linux-gnu
20+
os: ubuntu-latest
21+
archive: tar.gz
22+
- target: x86_64-unknown-linux-musl
23+
os: ubuntu-latest
24+
archive: tar.gz
25+
- target: aarch64-unknown-linux-gnu
26+
os: ubuntu-latest
27+
archive: tar.gz
28+
- target: x86_64-apple-darwin
29+
os: macos-latest
30+
archive: tar.gz
31+
- target: aarch64-apple-darwin
32+
os: macos-latest
33+
archive: tar.gz
34+
- target: x86_64-pc-windows-msvc
35+
os: windows-latest
36+
archive: zip
37+
- target: aarch64-pc-windows-msvc
38+
os: windows-latest
39+
archive: zip
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Install Rust toolchain
45+
uses: dtolnay/rust-action@stable
46+
with:
47+
toolchain: stable
48+
target: ${{ matrix.target }}
49+
50+
- name: Install cross-compilation tools
51+
if: matrix.target == 'aarch64-unknown-linux-gnu'
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y gcc-aarch64-linux-gnu
55+
56+
- name: Install musl tools
57+
if: matrix.target == 'x86_64-unknown-linux-musl'
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -y musl-tools
61+
62+
- name: Build release binary
63+
run: cargo build --release --target ${{ matrix.target }}
64+
env:
65+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
66+
67+
- name: Create archive (Unix)
68+
if: matrix.os != 'windows-latest'
69+
shell: bash
70+
run: |
71+
cd target/${{ matrix.target }}/release
72+
tar czf ../../../slack-${{ matrix.target }}.tar.gz slack
73+
cd ../../..
74+
75+
- name: Create archive (Windows)
76+
if: matrix.os == 'windows-latest'
77+
shell: pwsh
78+
run: |
79+
cd target/${{ matrix.target }}/release
80+
Compress-Archive -Path slack.exe -DestinationPath ../../../slack-${{ matrix.target }}.zip
81+
cd ../../..
82+
83+
- name: Upload artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: slack-${{ matrix.target }}
87+
path: slack-${{ matrix.target }}.${{ matrix.archive }}
88+
89+
release:
90+
name: Create Release
91+
needs: build
92+
runs-on: ubuntu-latest
93+
permissions:
94+
contents: write
95+
steps:
96+
- uses: actions/checkout@v4
97+
98+
- name: Download all artifacts
99+
uses: actions/download-artifact@v4
100+
with:
101+
path: artifacts
102+
103+
- name: Create checksums
104+
run: |
105+
cd artifacts
106+
for dir in */; do
107+
cd "$dir"
108+
sha256sum * > checksums.txt
109+
cd ..
110+
done
111+
112+
- name: Create Release
113+
uses: softprops/action-gh-release@v1
114+
with:
115+
files: |
116+
artifacts/**/*.tar.gz
117+
artifacts/**/*.zip
118+
artifacts/**/checksums.txt
119+
draft: true
120+
generate_release_notes: true
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

CHANGELOG.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2024-02-05
11+
12+
### Added
13+
14+
- **Authentication**
15+
- OAuth token support (xoxp- user tokens, xoxb- bot tokens)
16+
- Browser token support (xoxc- with xoxd cookie)
17+
- Secure token storage in system keyring
18+
- Multi-workspace support with workspace switching
19+
- `auth add`, `auth list`, `auth status`, `auth switch`, `auth remove` commands
20+
- `auth browser-help` for extracting browser tokens
21+
22+
- **Channels**
23+
- List channels with filtering by type (public, private, mpim, im)
24+
- Get channel info by ID or name
25+
- List direct messages
26+
- Export channels to CSV
27+
- Sort by popularity, exclude archived
28+
29+
- **Messages**
30+
- List messages in channels with count or time-based limits
31+
- Send messages to channels or threads
32+
- Read message text from stdin
33+
- View thread replies
34+
- Search messages with advanced query syntax
35+
- Get specific messages by ID or permalink
36+
- Mark channels as read
37+
38+
- **Users**
39+
- List workspace users with active-only filter
40+
- Get current user info (`users me`)
41+
- Get user info by ID or username
42+
- Export users to CSV
43+
44+
- **Files**
45+
- List files with filters (channel, user, types)
46+
- Get file info
47+
- Download files with size limits
48+
49+
- **Reactions**
50+
- Add reactions to messages
51+
- Remove reactions from messages
52+
- List reactions on messages
53+
54+
- **Status**
55+
- Get current status and presence
56+
- Set status with emoji, text, and expiration
57+
- Clear status
58+
- Set presence (away/auto)
59+
60+
- **Reminders**
61+
- List reminders
62+
- Create reminders with natural language time
63+
- Complete and delete reminders
64+
65+
- **Output**
66+
- JSON output by default (agent-friendly)
67+
- Plain TSV output with `--plain` flag
68+
- Structured error responses with error codes
69+
70+
- **Shell Completions**
71+
- Bash completions
72+
- Zsh completions
73+
- Fish completions
74+
- PowerShell completions
75+
76+
- **API Features**
77+
- Rate limiting with automatic retry
78+
- Configurable API base URL for testing
79+
- Channel and user name resolution
80+
- Edge API support for browser tokens
81+
82+
### Technical
83+
84+
- Built with Rust for performance and safety
85+
- Comprehensive test suite (unit + integration)
86+
- CI/CD workflows for testing and releases
87+
- No external config files required
88+
89+
[Unreleased]: https://github.com/user/slack-cli/compare/v0.1.0...HEAD
90+
[0.1.0]: https://github.com/user/slack-cli/releases/tag/v0.1.0

0 commit comments

Comments
 (0)