24 Commits

Author SHA1 Message Date
Yar Kravtsov
7f10e1ce8a feat(output): implement configurable color and emoji output
Add new output formatting system with flags for color and emoji control:
- Introduce OutputConfig and Writer structs for flexible output handling
- Add --colors and --emoji/--no-emoji global flags
- Refactor commands to use new Writer for consistent formatting
- Separate error content from presentation for better flexibility
2025-08-03 14:33:44 +03:00
Yar Kravtsov
43b68bc071 fix(init): prevent data loss when reinitializing with existing content 2025-07-30 10:41:03 +03:00
Yar Kravtsov
4cd8191805 style: standardize code formatting and whitespace 2025-07-29 09:04:57 +03:00
Yar Kravtsov
8a29b7fe43 feat(add): implement dry-run mode and enhance output formatting 2025-07-29 08:56:33 +03:00
Yar Kravtsov
a6852e5ad5 feat(add): implement recursive file addition with progress tracking 2025-07-29 08:47:14 +03:00
Yar Kravtsov
36d76c881c feat(add): implement multiple file addition with atomic operation 2025-07-29 08:32:33 +03:00
Yar Kravtsov
ae9cc175ce feat(bootstrap): add automatic environment setup with bootstrap scripts
Implement bootstrap functionality for streamlined dotfiles setup:
- Add 'bootstrap' command to run setup scripts manually
- Auto-execute bootstrap on 'init' with remote (--no-bootstrap to skip)
- Update README with bootstrap usage and examples
- Extend tests to cover bootstrap scenarios
2025-06-03 08:33:59 +03:00
Yar Kravtsov
1e2c9704f3 refactor(errors): implement structured error handling for improved debugging 2025-06-03 07:58:21 +03:00
Yar Kravtsov
3cba309c05 refactor(core): simplify Lnk creation with functional options pattern 2025-06-03 06:50:52 +03:00
Yar Kravtsov
02f342b02b refactor(core): simplify path handling and remove redundant generateRepoName function 2025-05-27 08:00:04 +03:00
Yar Kravtsov
92f2575090 fix: preserve directory structure for common files and fix display paths 2025-05-26 09:23:46 +03:00
Yar Kravtsov
093cc8ebe7 feat(multihost): add support for host-specific configurations
Implement multihost functionality allowing separate management of common and host-specific dotfiles. Add new commands and flags for handling host-specific files, update core logic for file storage and tracking, and enhance documentation to reflect new capabilities.
2025-05-26 08:26:06 +03:00
Yar Kravtsov
4a275ce4ca feat(cmd): add 'list' command to display managed files
Implements a new 'list' command that shows all files and directories managed by lnk, improving visibility and user experience.

fixes #4
2025-05-26 05:59:33 +03:00
Yar Kravtsov
84c507828d fix(status): detect and report uncommitted changes in repository status, fixes #5 2025-05-25 07:35:16 +03:00
Yar Kravtsov
d02f112200 fix(core): remove unnecessary Windows drive letter check in getRelativePath 2025-05-24 18:13:03 +03:00
Yar Kravtsov
f96bfb6ce0 fix: prevent file loss when multiple files have same basename
Fixes #2: https://github.com/yarlson/lnk/issues/2

Previously, files with the same basename (e.g., a/config.json and b/config.json)
would overwrite each other in the repository, causing data loss. The second file
would completely replace the first, and removing files would fail with 'no such
file or directory' errors.

Changes:
- Store files using unique names based on full relative paths (slashes → underscores)
- Track full relative paths in .lnk file instead of just basenames
- Generate repository names from relative paths to prevent collisions
- Update symlink restoration to work with new path-based system
- Add comprehensive tests for basename collision scenarios

This ensures each file maintains its unique content and can be managed
independently, eliminating the data loss issue.
2025-05-24 18:10:20 +03:00
Yar Kravtsov
61a9cc8c88 feat: enhance CLI output with colorful and informative messages 2025-05-24 10:13:00 +03:00
Yar Kravtsov
905d88e0cf feat: simplify README and improve init command 2025-05-24 08:52:27 +03:00
Yar Kravtsov
d730007fb3 feat: add directory support and .lnk tracking
- Add directory management support alongside individual files

- Implement .lnk tracking file to manage files and directories

- Update filesystem validation to allow directories

- Add MoveDirectory method for handling directory operations

- Use git rm --cached to properly handle directory removal

- Add comprehensive tests for directory operations

- Update README with directory support documentation

- All 20 integration tests passing

Breaking: None (backward compatible)

Resolves: Git limitation of not tracking directories
2025-05-24 08:25:34 +03:00
Yar Kravtsov
88b3fbd238 feat: implement phase 1 sync functionality
- Add lnk status command to show repository sync status

- Add lnk push command for smart staging, committing, and pushing

- Add lnk pull command with automatic symlink restoration

- Add comprehensive sync functionality to git and core packages

- Add 5 new integration tests for sync commands (17 total tests)

- Update README with sync workflow examples and documentation

- Support commits ahead/behind tracking relative to remote

- Implement change detection to avoid empty commits

- Add graceful error handling for missing remotes

Closes: Phase 1 sync implementation
2025-05-24 07:20:49 +03:00
Yar Kravtsov
2e4995eeb1 feat: implement comprehensive edge case handling for init command - Make lnk init idempotent and safe with repository protection, idempotent remote handling, comprehensive tests, and updated documentation 2025-05-24 06:49:06 +03:00
Yar Kravtsov
be22511a8d fix: handle return values in error cleanup blocks (golangci-lint) 2025-05-24 06:28:26 +03:00
Yar Kravtsov
f640d6d11e feat: add --remote flag to init command for adding origin remote 2025-05-24 06:26:43 +03:00
Yar Kravtsov
9088bbda50 feat: initial Lnk CLI implementation 2025-05-24 06:17:52 +03:00