CLI to inspect and set file timestamps (atime, mtime, btime, and best-effort ctime).
Project description
timectl
Command-line tool to inspect and adjust file and directory timestamps (atime, mtime, btime, and best-effort ctime).
Testing: This project has only been tested on macOS 26. Behavior on other operating systems or versions is not guaranteed.
Requirements
- Python 3.10 (see
pyproject.toml)
Install
Recommended: add the CLI from PyPI with uv’s tool installer (see Using tools):
uv tool install timectl
timectl --help
To run a one-off command without installing the tool globally, use uvx (alias for uv tool run):
uvx timectl --help
uvx timectl inspect .
You can also install from PyPI with pip:
pip install timectl
timectl --help
To work on this repository from a clone, use uv sync and uv run timectl ….
Commands
inspect
Show atime, mtime, ctime, and btime (when available) for a single path. Times are printed in the system local timezone.
timectl inspect # default: current directory
timectl inspect path/to/file
set
Update timestamps for one root path (default: current directory). By default, directories are processed recursively (all entries under the tree).
timectl set [path] [--time <value>] [--fields <letters>] [--no-recursive]
| Option | Description |
|---|---|
--time |
Target time; default is now. See Time formats. |
--fields |
Which fields to change: a (atime), m (mtime), c (ctime), b (btime). Default: amcb. |
--no-recursive |
Do not walk into subdirectories when path is a directory. |
Field notes:
a/m: Set viaos.utimeto the value of--time.b: On macOS, the tool tries Apple’sSetFile(from Xcode Command Line Tools) when available; otherwisebmay be skipped with a reason in the output.c: The system does not allow settingctimeto an arbitrary value. Withcin--fields, the tool refreshesctimeto the current moment after other updates. Thereforecis only allowed when--timeisnow(including the default). If--timeis anything else andcis included (including the defaultamcb), the command exits with an error—use e.g.--fields ambto omitc.
Time formats
now- ISO 8601 (e.g.
2026-03-30T12:34:56+08:00) YYYY-MM-DD HH:MM:SS(interpreted in the local timezone if no offset is given)- Unix seconds:
@1711767296 - Nanoseconds:
@1711767296000000000ns
Examples
# Inspect a file
timectl inspect ./README.md
# Set everything to now under current directory (default path, --time, --fields)
timectl set
# Set everything to now under a given root
timectl set ./some/dir
# Set atime/mtime/btime to a fixed time (omit c)
timectl set ./file.txt --time "2026-03-30 22:00:00" --fields amb
# Only touch the directory itself, not children
timectl set ./folder --no-recursive --time now
Limitations
ctimecannot be set to a specific historical time; only a “touch to now” style refresh is supported, and only when--timeisnow.btimesupport depends on the platform and tools (on macOS,SetFileis used when present).- Cross-platform and cross-filesystem timestamp semantics differ; this tool does not promise identical results outside the tested environment.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timectl-0.1.0.tar.gz.
File metadata
- Download URL: timectl-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de092b3b414b9475a832e81e99bfd8586bdd8ad2f7a29838152dde82f99c5ab8
|
|
| MD5 |
8cf939a8c0a5cfb063857a46a6febe14
|
|
| BLAKE2b-256 |
9a03d38092f7b07f3ca3f6a1664fdd95aa0b42436817c7b84e022ba0fd13d3ba
|
Provenance
The following attestation bundles were made for timectl-0.1.0.tar.gz:
Publisher:
publish.yml on touken928/timectl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timectl-0.1.0.tar.gz -
Subject digest:
de092b3b414b9475a832e81e99bfd8586bdd8ad2f7a29838152dde82f99c5ab8 - Sigstore transparency entry: 1199804257
- Sigstore integration time:
-
Permalink:
touken928/timectl@94312620c928220c3fe2c64c8a6d00197810aff5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/touken928
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@94312620c928220c3fe2c64c8a6d00197810aff5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file timectl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: timectl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc118bd931271b0c1ccabdf017fa8d30b311d0b9af5c6355d7e0d2600fc5ec82
|
|
| MD5 |
01c7a5ae016e1160ff22814a1d45fb79
|
|
| BLAKE2b-256 |
f510917c21c9f122c386e339057d830dc80b02848606749cca77ab8bd13f8498
|
Provenance
The following attestation bundles were made for timectl-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on touken928/timectl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timectl-0.1.0-py3-none-any.whl -
Subject digest:
bc118bd931271b0c1ccabdf017fa8d30b311d0b9af5c6355d7e0d2600fc5ec82 - Sigstore transparency entry: 1199804267
- Sigstore integration time:
-
Permalink:
touken928/timectl@94312620c928220c3fe2c64c8a6d00197810aff5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/touken928
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@94312620c928220c3fe2c64c8a6d00197810aff5 -
Trigger Event:
push
-
Statement type: