Skip to content

Commit 7861aaa

Browse files
committed
better readme
1 parent c0e56df commit 7861aaa

1 file changed

Lines changed: 99 additions & 33 deletions

File tree

README.md

Lines changed: 99 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,120 @@
11
# dots
22

3-
`dots` is yet another dotfiles management tool.
3+
Yet another dotfiles management tool.
44

5-
TODO: badges, plenty of them!
5+
## :sparkles: Features
66

7-
## Features
7+
- :link: Dotfiles stored in a central folder and symlinked to their real location
8+
- :repeat: Automatic git versioning on every change
9+
- :computer: Per-machine configuration via hostname-based config sections
10+
- :warning: Conflict detection and resolution during sync
811

9-
- dotfiles stored in a central folder and symlinked by `dots` to their real location
10-
- handles versioning, Git knowledge should not be required to use `dots`
11-
- can store multiple machines configuration (one branch per machine, named after its hostname)
12-
- private files (SSH keys, configuration files containing credentials, etc.) can be stored encrypted
12+
## :clipboard: Requirements
1313

14-
## Dependencies
14+
- Python 3.12+
15+
- git
1516

16-
TODO
17+
## :package: Installation
1718

18-
## Installation
19+
Clone the repository and install with [uv](https://docs.astral.sh/uv/):
1920

20-
TODO
21+
```bash
22+
git clone https://github.com/mdeous/dots.git
23+
cd dots
24+
uv sync
25+
```
2126

22-
## Configuration
27+
Or with pip:
2328

24-
The `dots` configuration file should be located at `${HOME}/.dots.conf`, and is organized in sections
25-
in the same way as a `.ini` file. The configuration file can handle settings for multiple machines, so
26-
that it also can be synced (by default, `dots` automatically adds its configuration when the repo is
27-
initialized).
29+
```bash
30+
git clone https://github.com/mdeous/dots.git
31+
cd dots
32+
pip install .
33+
```
2834

29-
The global section is `DEFAULT` (case-sensitive), which holds default values that can be overriden for in
30-
the other sections. Each machine settings are stored in a separate section named after the machine hostname.
35+
## :gear: Configuration
3136

32-
The values that can be used in each sections are :
37+
The configuration file should be located at `~/.dots.conf`.
3338

34-
- `repo_dir` : custom repository path (default: `~/dots`)
35-
- `gpg_key_id` : ID of the GPG key to use for file encryption (default: none)
36-
- `ignored_files` : comma-separated list of files that should'nt be synced
39+
Settings are organized in sections named after the machine's hostname. The `[DEFAULT]` section provides fallback values used when no hostname-specific section exists.
3740

38-
An example configuration can be found in the `sample-config.conf` file located in the same folder as this
39-
README.
41+
### Available settings
4042

41-
## Usage
43+
| Key | Description | Default |
44+
| --------------- | --------------------------------------------------------- | -------- |
45+
| `repo_dir` | Path to the dotfiles repository | `~/dots` |
46+
| `gpg_key_id` | GPG key ID for file encryption | _none_ |
47+
| `ignored_files` | Comma-separated list of glob patterns to skip during sync | _none_ |
4248

43-
TODO
49+
### Example
4450

45-
## Files layout
51+
```ini
52+
[DEFAULT]
53+
repo_dir = ~/dots
4654

47-
- `dots` configuration file is `${HOME}/.dots.conf`
48-
- dotfiles are stored in `${HOME}/dots/files`
49-
- encrypted files are stored in `${HOME}/dots/encrypted`
50-
- decrypted files (symlink targets) are not versioned and are stored in `${HOME}/dots/decrypted`
55+
[work-laptop]
56+
repo_dir = ~/dotfiles
57+
ignored_files = .bashrc, .config/personal/*
5158

52-
## License
59+
[home-desktop]
60+
gpg_key_id = ABCDEF1234567890
61+
```
5362

54-
This project is licensed under the BSD 3-clause license.
63+
## :rocket: Usage
64+
65+
### Global options
66+
67+
```text
68+
dots [--config PATH] [--verbose] [--version] COMMAND
69+
```
70+
71+
| Option | Short | Description |
72+
| ----------- | ----- | --------------------------------------------- |
73+
| `--config` | `-c` | Path to config file (default: `~/.dots.conf`) |
74+
| `--verbose` | `-v` | Display debug information |
75+
| `--version` | `-V` | Display version and exit |
76+
77+
### `dots add <file>`
78+
79+
Add a file to the repository. The file is copied into the repo and replaced with a symlink.
80+
81+
```bash
82+
dots add ~/.bashrc
83+
dots add ~/.config/git/config
84+
```
85+
86+
### `dots remove <file>`
87+
88+
Remove a file from the repository. The symlink is replaced with the original file.
89+
90+
```bash
91+
dots remove ~/.bashrc
92+
```
93+
94+
### `dots list`
95+
96+
List all files in the repository and their sync status.
97+
98+
```bash
99+
dots list
100+
```
101+
102+
### `dots sync`
103+
104+
Synchronize the repository with the filesystem. Creates missing symlinks and detects conflicts.
105+
106+
```bash
107+
dots sync
108+
```
109+
110+
| Option | Short | Description |
111+
| ---------------- | ----- | ---------------------------------------------- |
112+
| `--force-relink` | `-r` | Overwrite links that point to the wrong target |
113+
| `--force-add` | `-a` | Overwrite the repo version with the local file |
114+
| `--force-link` | `-l` | Overwrite the local file with the repo version |
115+
116+
`--force-add` and `--force-link` are mutually exclusive. Without force flags, `dots` prompts interactively when conflicts are found.
117+
118+
## :scroll: License
119+
120+
BSD 3-Clause. See [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)