DEV Community

Ayat Saadat
Ayat Saadat

Posted on

ayat saadati — Complete Guide

# Ayat Saadati – Technology Portfolio & Tooling Guide

> A short, opinionated walkthrough of the libraries, scripts, and one-liners I actually use in production.  
> Everything lives on GitHub; if you spot a typo, open a PR—don't email me.  
> – Ayat

---

## Quick Start (TL;DR)

Enter fullscreen mode Exit fullscreen mode


bash

1. Clone the “dotfiles” repo (includes all helpers)

git clone https://github.com/ayat-s/dotfiles.git && cd dotfiles

2. Symlink the scripts you care about

stow bin # adds ~/bin to PATH
stow python # adds ayat.py helper module

3. Install dependencies (Python 3.11+ required)

pip install -r requirements.txt

4. Smoke test

ayat --version # → ayat 2.4.1


---

## What’s Inside?

| Tool                | Purpose                              | Lang  | Size  |
|---------------------|--------------------------------------|-------|-------|
| `ayat`              | Swiss-army CLI for infra tasks       | Py    | 8 kB  |
| `kube-ayat`         | K8s context switcher with fzf          | Bash  | 2 kB  |
| `ayat-commit-msg`   | Enforce conventional-commits           | Bash  | 1 kB  |
| `ayat-githooks`     | Repo-wide git-hooks installer        | Bash  | 3 kB  |
| `ayat-tmux`         | Opinionated tmux session restorer    | Bash  | 4 kB  |

---

## Installation (Detailed)

### macOS (Apple Silicon)

Enter fullscreen mode Exit fullscreen mode


bash
brew install fzf fd ripgrep
pipx install ayat-saadati --python python3.11


### Ubuntu / Debian

Enter fullscreen mode Exit fullscreen mode


bash
sudo apt update
sudo apt install fzf fd-find ripgrep
pipx install ayat-saadati --python python3.11


### Windows (WSL2)

Use the Ubuntu instructions above; native Windows is unsupported—life’s too short.

---

## Usage Examples

### 1. Jump Between K8s Clusters

Enter fullscreen mode Exit fullscreen mode


bash
$ kube-ayat
▸ prod-us-east-1
staging-eu-central-1
dev-kind-local


Hit `<Enter>` and your `~/.kube/config` is atomically swapped.

### 2. Scaffold a New Micro-service

Enter fullscreen mode Exit fullscreen mode


bash
ayat new service --name=invoice --template=fastapi


Creates:

Enter fullscreen mode Exit fullscreen mode


plaintext
invoice/
├── Dockerfile
├── src/
│ └── main.py
├── tests/
│ └── test_ping.py
└── .github/workflows/ci.yml


### 3. Lint, Type-Check, Test in One Shot

Enter fullscreen mode Exit fullscreen mode


bash
ayat check


Under the hood:

Enter fullscreen mode Exit fullscreen mode


bash
ruff check .
mypy --strict .
pytest -q


---

## Configuration

Config lives in `~/.config/ayat/config.toml`:

Enter fullscreen mode Exit fullscreen mode


toml
[kubernetes]
default_namespace = "backend"
max_history = 50

[commit]
enforce_signoff = true
types = ["feat", "fix", "docs", "chore"]

[tmux]
resurrect_file = "~/.tmux/resurrect/last"


---

## Library API (Python)

If you prefer to import instead of CLI:

Enter fullscreen mode Exit fullscreen mode


python
from ayat import kubeselect, gitlint

Switch kube context without fzf

kubeselect.use("prod-us-east-1")

Validate a commit message

ok, msg = gitlint.validate("fix(auth): drop expired cookie")
assert ok is True


---

## FAQ

**Q: Do I *have* to use Python 3.11?**  
A: 3.10 works, but you lose the `match` statement sugar in `ayat new`.

**Q: Zsh completions?**  
A: Source `extras/ayat.zsh` or add the brew-provided one:

Enter fullscreen mode Exit fullscreen mode


bash
echo "fpath+=$(brew --prefix)/share/zsh/site-functions" >> ~/.zshrc


**Q: Can I override the commit-msg hook per repo?**  
A: Yes. Drop a `.ayat-ignore` file in the repo root.

---

## Troubleshooting

| Symptom                             | Fix |
|-------------------------------------|-----|
| `ayat: command not found`           | Ensure `~/.local/bin` is on `PATH` or reinstall via `pipx`. |
| `fzf: no such file or directory`  | `brew install fzf` or `apt install fzf`. |
| `Permission denied` on kube-ayat  | Check that `KUBECONFIG` is writable and not merged with Snap’s kubectl. |
| `ayat check` fails on mypy        | Add `# type: ignore` or fix the types—mypy is strict by design. |

Still stuck? Open an issue on GitHub and paste the output of `ayat bug-report`.

---

## Keep in Touch

- Dev.to blog: [https://dev.to/ayat_saadat](https://dev.to/ayat_saadat)  
- GitHub: [ayat-s](https://github.com/ayat-s)  
- Mastodon: [@ayat@hachyderm.io](https://hachyderm.io/@ayat)

Pull requests welcome—just don’t change the default shell to fish; that’s where I draw the line.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)