Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a9cc7c2
feat: add devbox and task
kai687 Jan 29, 2025
e8c5770
chore: update go packages
kai687 Jan 29, 2025
988234d
feat: Update Dockerfile
kai687 Feb 6, 2025
ac2ab6f
fix: update workflows for new go
kai687 Jan 30, 2025
9fde0a4
feat(v4): add V4 client package
kai687 Jan 29, 2025
c0ece92
feat(v4): migrate indices list
kai687 Jan 29, 2025
dc865aa
feat(v4): migrate indices copy
kai687 Jan 30, 2025
9330f75
feat(v4): migrate indices move
kai687 Jan 30, 2025
f020d8d
feat(v4): migrate indices clear
kai687 Jan 30, 2025
3672504
feat(v4): migrate indices delete
kai687 Jan 30, 2025
0c45dc5
feat(v4): migrate indices export and import
kai687 Feb 13, 2025
f36741b
feat(v4): migrate indices analyze
kai687 Feb 13, 2025
2a7fded
feat(v4): migrate apikeys create
kai687 Feb 13, 2025
beeaecc
feat(v4): migrate apikeys delete
kai687 Feb 13, 2025
fb8e35b
feat(v4): migrate apikeys list
kai687 Feb 3, 2025
c3a485c
feat(v4): migrate apikeys get
kai687 Feb 3, 2025
d59faea
feat(v4): migrate search
kai687 Feb 13, 2025
e056725
feat(v4): migrate settings get
kai687 Feb 3, 2025
9b417d7
feat(v4): migrate settings set
kai687 Feb 13, 2025
2d48a38
feat(v4): migrate settings import
kai687 Feb 13, 2025
cdde024
feat(v4): add alias for objects
kai687 Feb 3, 2025
80c428a
feat(v4): migrate objects browse
kai687 Feb 13, 2025
fb8e6f8
feat(v4): migrate objects delete
kai687 Feb 13, 2025
f817ed2
feat(v4): migrate objects import
kai687 Feb 13, 2025
20d3182
feat(v4): migrate objects operations
kai687 Feb 3, 2025
3e8f8b2
feat(v4): migrate objects update
kai687 Feb 13, 2025
945de33
feat(v4): migrate rules browse
kai687 Feb 13, 2025
d77be51
feat(v4): migrate rules delete
kai687 Feb 13, 2025
f0e1d28
feat(v4): migrate rules import
kai687 Feb 13, 2025
257edb9
feat(v4): migrate synonyms browse
kai687 Feb 13, 2025
60f8706
feat(v4): migrate synonyms delete
kai687 Feb 13, 2025
fbfd7c9
feat(v4): migrate synonyms save
kai687 Feb 13, 2025
0771751
feat(v4): migrate synonyms import
kai687 Feb 13, 2025
74733da
feat(v4): add dict shortcut
kai687 Feb 4, 2025
69a72d8
feat(v4): migrate dictionary settings get
kai687 Feb 4, 2025
f7e7436
feat(v4): migrate dictionary settings set
kai687 Feb 13, 2025
7d6ffb4
feat(v4): migrate dictionary entries browse
kai687 Feb 13, 2025
6f1f677
feat(v4): migrate dictionary entries clear
kai687 Feb 13, 2025
3b47eac
feat(v4): migrate dictionary entries delete
kai687 Feb 13, 2025
774349a
feat(v4): migrate dictionary entries import
kai687 Feb 13, 2025
fa77c9a
fix(v4): remove unused shared code
kai687 Feb 13, 2025
b9643ef
feat(v4): migrate events tail
kai687 Feb 13, 2025
a932cb9
chore(v4): format crawler files
kai687 Feb 13, 2025
fea2b39
feat: alias for profile list
kai687 Feb 13, 2025
d38f09e
feat(v4): update type in Crawler API to v4
kai687 Feb 5, 2025
bf3b639
feat: shortcuts for crawler commands
kai687 Feb 12, 2025
9422824
feat: remove art command
kai687 Feb 13, 2025
f4ff399
chore(v4): update IndexNames helper function
kai687 Feb 5, 2025
f087418
fix: remove v3 client from cli
kai687 Feb 5, 2025
24baf9f
fix: support custom hosts
kai687 Feb 5, 2025
93ec6cf
chore: lint and format files
kai687 Jan 31, 2025
75906db
chore: update readme
kai687 Feb 12, 2025
b441863
chore: update packages
kai687 Mar 14, 2025
f41ea4d
Merge branch 'main' into feat/v4
kai687 Mar 14, 2025
7075318
fix: formatting
kai687 Mar 14, 2025
75bd1a0
chore: go mod tidy
kai687 Mar 14, 2025
bc21ace
fix: update flags from spec
kai687 Mar 14, 2025
44f0219
fix: better separate user agent
kai687 Mar 14, 2025
8835d58
Merge pull request #1 from kai687/feat/v4
kai687 Mar 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Automatically sets up your devbox environment whenever you cd into this
# directory via our direnv integration:

eval "$(devbox generate direnv --print-envrc)"

# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# for more details
16 changes: 8 additions & 8 deletions .github/workflows/api-specs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: Scheduled API Specs Pull Request
on:
schedule:
- cron: '0 */12 * * *'

jobs:
api-specs-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.19
- run: |
git config --global user.name "algolia-ci"
git config --global user.email "noreply@algolia.com"
go-version: 1.23
- run: make api-specs-pr
env:
GH_TOKEN: ${{ secrets.GH_SECRET }}
GH_TOKEN: ${{ secrets.GH_SECRET }}
GIT_COMMITTER_NAME: algolia-ci
GIT_AUTHOR_NAME: algolia-ci
GIT_COMMITTER_EMAIL: noreply@algolia.com
GIT_AUTHOR_EMAIL: noreply@algolia.com
11 changes: 3 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: Go

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.19

go-version: 1.23
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
30 changes: 5 additions & 25 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,11 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: 1.18
- uses: actions/checkout@v3
go-version: 1.23
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.47.3

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
version: v1.63.4
18 changes: 7 additions & 11 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
name: goreleaser

on:
push:
tags:
- "v*"

permissions:
contents: write # publishing releases

contents: write # publishing releases
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23
- name: Install chocolatey
run: |
mkdir -p /opt/chocolatey
Expand All @@ -30,15 +27,15 @@ jobs:
env:
CHOCOLATEY_VERSION: 1.2.0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.8.0
uses: goreleaser/goreleaser-action@v6
with:
version: "~1.13.1"
version: "~> v2"
args: release
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
- name: Docs checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: algolia/doc
path: docs
Expand All @@ -53,4 +50,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
run: |
make docs-pr
make VARIATON=new docs-pr
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ vendor/
# local build
algolia

# Ignore docs directory
docs/
# Environment variables
*.env
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linters:
enable:
- gosec
- gofumpt
- stylecheck
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM alpine
RUN apk update && apk upgrade && \
apk add --no-cache ca-certificates
COPY algolia /bin/algolia
ENTRYPOINT ["/bin/algolia"]
# Build the binary
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY . .
ARG VERSION=docker
RUN apk update && apk add --no-cache curl
RUN go mod download
RUN go install github.com/go-task/task/v3/cmd/task@latest
RUN task download-spec-file && VERSION=${VERSION} task build

FROM alpine:3
RUN apk update && apk upgrade && apk add --no-cache ca-certificates
COPY --from=builder /app/algolia /bin/algolia
ENTRYPOINT ["/bin/algolia"]
60 changes: 40 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,69 @@
# Algolia CLI

A command line interface to enable Algolia developers to interact with and configure their Algolia applications straight from a command line or terminal window. Automate common workloads, create snapshots, revert to backups, or quickly modify applications as needed! This is a lightweight tool, providing a text-only interface, that is easy to install and use!
The Algolia CLI lets you work with your Algolia resources,
such as indices, records, API keys, and synonyms,
and from the command line.

![cli](https://user-images.githubusercontent.com/5702266/153008646-1fd8fbf2-4a4d-4421-b2f2-0886487f3e27.png)

## Documentation

See the [documentation](https://algolia.com/doc/tools/cli/) for setup and usage instructions.
See [Algolia CLI](https://algolia.com/doc/tools/cli/) in the Algolia documentation for setup and usage instructions.

## Installation

### Build from Source
### macOS

A `Makefile` is available to help installing and building the CLI.
The Algolia CLI is available on [Homebrew](https://brew.sh/) and as a downloadable binary from the [releases page](https://github.com/algolia/cli/releases).

```bash
git clone git@github.com:algolia/cli.git && make install
```sh
brew install algolia/algolia-cli/algolia
```

### MacOS
### Linux

`algolia` is available on Homebrew and as a downloadable binary from the [releases page](https://github.com/algolia/cli/releases).
The Algolia CLI is available as a `.deb` package:

```bash
brew tap algolia/algolia-cli && brew install algolia
```sh
# Select the package appropriate for your platform:
sudo dpkg -i algolia_*.deb
```

as a `.rpm` package:

```sh
# Select the package appropriate for your platform
sudo rpm -i algolia_*.rpm
```

or as a tarball from the [releases page](https://github.com/algolia/cli/releases):

```sh
# Select the archive appropriate for your platform
tar xvf algolia_*_linux_*.tar.gz
```

### Windows

`algolia` is available via [Chocolatey](https://community.chocolatey.org/packages/algolia/) and as downloadable .exe files.
The Algolia CLI is available via [Chocolatey](https://community.chocolatey.org/packages/algolia/) and as a downloadable binary from the [releases page](https://github.com/algolia/cli/releases)

#### Chocolatey
### Community packages

| Install: | Upgrade: |
| ------------------ | ------------------ |
| `choco install algolia` | `choco upgrade algolia` |
Other packages are maintained by the community, not by Algolia.
If you distribute a package for the Algolia CLI, create a pull request so that we can list it here!

#### Executable
### Build from source

Executable files are available on the [releases page](https://github.com/algolia/cli/releases).
To build the Algolia CLI from source, you'll need:

### Other platforms
- Go version 1.23 or later
- [Go task](https://taskfile.dev/)

Download packaged binaries from the [releases page](https://github.com/algolia/cli/releases).
1. Clone the repo: `git clone https://github.com/kai687/cli.git algolia-cli && cd algolia-cli`
1. Run: `task build`

## Support

Found a bug on the CLI? [Open a new issue](https://github.com/algolia/cli/issues/new) or [contact the support](https://www.algolia.com/support/) to get help with Algolia!
If you found an issue with the Algolia CLI,
[open a new GitHub issue](https://github.com/algolia/cli/issues/new),
or join the Algolia community on [Discord](https://alg.li/discord).
Loading
Loading