hstratus-drive: Access iCloud Drive

[ bsd3, library, network ] [ Propose Tags ] [ Report a vulnerability ]

Browse and download files from iCloud Drive using an authenticated session from the hstratus-auth library.

Provides access to the main CloudDocs tree: fetching the root folder, listing folder contents, downloading files, and mutating the tree (create, rename, delete, upload).

This library is unofficial and not supported by Apple. It may break without warning if Apple changes their API.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2
Change log ChangeLog.md
Dependencies aeson (>=2.0 && <2.3), base (>=4.12 && <5), bytestring (>=0.10.8 && <0.11 || >=0.11.3 && <0.13), containers (>=0.6 && <0.8), hstratus-auth (>=0.1 && <0.3), hstratus-drive, http-client (>=0.5 && <0.8), http-types (>=0.12.1 && <0.13), text (>=1.2.3 && <2.2), time (>=1.9 && <1.15), vector (>=0.12 && <0.14) [details]
Tested with ghc ==9.2.8, ghc ==9.4.8, ghc ==9.6.7, ghc ==9.8.4, ghc ==9.10.2, ghc ==9.12.1
License BSD-3-Clause
Copyright (c) 2026 Tim Emiola
Author Tim Emiola
Maintainer Tim Emiola <adetokunbo@emio.la>
Uploaded by adetokunbo at 2026-07-30T13:38:44Z
Category Network
Source repo head: git clone https://github.com/adetokunbo/hstratus.git(hstratus-drive)
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-07-30 [all 1 reports]

Readme for hstratus-drive-0.1.0.2

[back to package description]

hstratus-drive — access to iCloud Drive

hstratus-drive browses, downloads, and mutates files in iCloud Drive using an authenticated session from hstratus-auth.

The library provides access to the main CloudDocs tree: fetching the root folder, listing folder contents, downloading files, and mutating the tree (create, rename, delete, upload).

Disclaimer — use at your own risk

  • This library is unofficial and not supported by Apple.
  • The iCloud Drive API it uses is undocumented and may change without notice.

Usage

After a successful login with hstratus-auth, construct a DriveApi value and use it to browse, download, or mutate files.

Browsing

import Network.HStratus.Http (mkApi, login, AuthState (..))
import Network.HStratus.Http.Endpoints (Realm (..))
import Network.HStratus.Drive

example :: IO ()
example = do
  api <- mkApi Usual
  result <- login api
  case result of
    Authenticated sess ad -> do
      da    <- mkDriveApi ad sess api
      root  <- driveRoot da
      nodes <- listFolder da (fnId root)
      mapM_ print nodes
    _ -> putStrLn "Unexpected result"

Downloading

downloadExample :: DriveApi -> FileData -> IO ()
downloadExample da fd = do
  bytes <- downloadFile da fd
  -- bytes :: Data.ByteString.Lazy.ByteString
  print (Data.ByteString.Lazy.length bytes)

Mutating

mutationExample :: DriveApi -> FolderData -> IO ()
mutationExample da folder = do
  createFolder da (fnId folder) "New Folder"
  -- renameNode, deleteNode, and uploadFile follow the same pattern

CLI usage

A command-line interface using this behaviour is provided by the hstratus package. Use hstratus drive ls to list Drive contents and hstratus drive cp to download files.


Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries and regions. iCloud is a service mark of Apple Inc., registered in the U.S. and other countries and regions.