Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/singe/tidcli
A simple touchID prompt'er for use in shell scripts.
https://github.com/singe/tidcli
Last synced: 8 days ago
JSON representation
A simple touchID prompt'er for use in shell scripts.
- Host: GitHub
- URL: https://github.com/singe/tidcli
- Owner: singe
- License: gpl-3.0
- Created: 2024-05-31T08:29:14.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-18T12:52:16.000Z (5 months ago)
- Last Synced: 2024-08-01T13:32:28.176Z (3 months ago)
- Language: Swift
- Size: 18.6 KB
- Stars: 86
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-repos - singe/tidcli - A simple touchID prompt'er for use in shell scripts. (Swift)
README
# Outrageously simple touch ID command line prompter
Touch ID Command Line Interface (tidcli) simply pops a Touch ID prompt.
It returns an exit code of 0 on success and 1 on failure.
You can use this to embed additional authentication steps into your shell script or the like.
# Usage
`tidcli [optional prompt context]`
Optional custom prompt information can be passed as the first argument. This is limited to 100 characters.
An example of using it in a bash shell script to exit if there is an authentication failure is:
```
tidcli "EXAMPLE SCRIPT"
if [[ "$?" -ne 0 ]]; then
exit 1
fi
```# Installing
Download the appropriate binary from the releases page.
# Building
Build a release binary with swift by running:
`swift build -c release`
The resulting binary will be in the `.build/release` directory as `tidcli`.
# Notes
## Password fallback not allowed
The Touch ID prompt will contain a "Use Password" button, but only biometric authentication is allowed, so clicking it will result in an authentication failure. If you wanted to change this you could use `.deviceOwnerAuthentication` instead of `.deviceOwnerAuthenticationWithBiometrics`.
## Output on standard error
Success and failure messages are output to standard error.
# Sandbox Execution
A macOS sandbox profile is included if you're so inclined. You can execute it with `sandbox-exec` and just need to pass the full path of where the binary is located. For example:
`sandbox-exec -D_PWD="$PWD/tidcli" -f tidcli.sb tidcli`