pacmax beta

Alfred Pac by BenjaminOddou on GitHub

dashlane

🔐 Manage your Dashlane vault

From their README

logo-dark logo-light

made with heart by Benjamin Oddou saythanks Python 3.9+

Welcome to the Alfred Dashlane repository: An Alfred Workflow ✨

✅ Prerequisites

  • macOS.
  • Alfred 5 or Alfred 6. Note that the Alfred Powerpack is required to use workflows.
  • A Dashlane account protected by a master password.
  • Python 3.9 or above (python3 --version).
  • The Dashlane CLI (dcli), see below.

🏎️ Dashlane CLI

This workflow uses the Dashlane CLI provided by the Dashlane team. Install it with Homebrew or manually:

brew install dashlane/tap/dashlane-cli

The workflow finds dcli in your PATH, /opt/homebrew/bin, /usr/local/bin, ~/.local/bin or ~/bin. Otherwise, set 🛠️ dcli path in the configuration.

The CLI must keep its default save-master-password setting (true): the workflow relies on the CLI staying unlocked between two searches. If you want to know how the CLI stores data on your computer, check this README.

This workflow can't add or edit items, and it handles one account at a time.

⬇️ Installation

  1. Download the workflow
  2. Double click the .alfredworkflow file to install
  3. Fill 👤 Login with the email of your Dashlane account

🧙‍♂️ Invoke the workflow

There are 2 flows in this workflow:

  1. pdash displays all the credentials of your Dashlane vault.
  2. odash displays the credentials that have an OTP (2FA code).

You can edit these triggers (flagged with a 🕹️ symbol) in the user configuration panel.

🤖 Usage of the workflow

Setup variables

  1. 👤 Login: email of your Dashlane account. It is required to start the workflow.
  2. 🫥 Incognito mode: hide partially your logins in Alfred. If ticked:

incognito_yes

if unticked:

incognito_no

  1. 🔥 Allow cache: keep the list of your items (titles, URLs and logins, never passwords or OTP secrets) in the workflow cache folder while the CLI is unlocked. The list shows instantly and is refreshed in the background. It is deleted as soon as the vault is locked, even when you lock it from the terminal.
  2. 🧹 Clear clipboard: erase a copied password / OTP from the clipboard after this delay (default 30 s).
  3. 🔔 Notifications: show the result of an action in a native macOS notification (default on).
  4. 🎷 Notification sound: sound played with the notifications: Mute or one of the macOS sounds (default Submarine), as in Alfred Plex.
  5. 🛠️ dcli path: only needed if the CLI isn't found automatically.

Feedback

Results come as native macOS notifications, posted by Alfred's Post Notification object (Alfred 6 uses Apple's UserNotifications API for them):

  • copies name the item and say when the clipboard will be cleared (📋 Password copied · GitHub · cleared in 30 s), never the copied value;
  • after login, unlock, sync, device removal or an error, Alfred also shows the list again;
  • lock, logout, clear cache and favicon downloads just notify.

Results are never added as a line of the list. With 🔔 Notifications off, actions are silent.

The menu (Sync, Lock, Devices, Download favicons, Clear cache, Logout) always stays at the top of the list, in this order, followed by your items sorted by title. Items carry no Alfred uid, so Alfred can't move often-used items up, even with what it learned from older versions of the workflow.

Login

Press ⏎ on Login to Dashlane. A Dashlane page opens in your browser, then the workflow asks, in native macOS dialogs:

  1. the token shown in the browser,
  2. the 6-digit code received by email (or from your authenticator app),
  3. your master password (hidden).

This Mac is then registered as a device of your account and your vault is synced.

Get passwords and OTPs

Search an item by its title, its website or (when incognito is off) its login.

  1. ↩︎ copy the password (odash: the OTP code).
  2. ⌘↩︎ copy the login.
  3. ⌥↩︎ open the URL.
  4. ⇧↩︎ type login ⇥ password in the frontmost application (Alfred needs the Accessibility permission).
  5. ⌃↩︎ copy the OTP code (pdash, items with 2FA).

Sync

❗ You need an internet connection.

Press ⏎ on Sync to download the latest changes of your vault. The CLI also syncs on its own once per hour.

Lock / Unlock

Lock locks the CLI. Unlock asks your master password in a hidden dialog (plus a 2FA code if your account asks for it at every login).

Download favicons

❗ You need an internet connection.

Downloads the missing icons of your websites in the background, 8 at a time, in the workflow cache folder (~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.benjamino.dashlane). ⚠️ The domains of your accounts are sent to Google's favicon service.

Clear cache

Deletes the cached list and the downloaded favicons from the workflow cache folder. The list is rebuilt from the CLI the next time you open the workflow (if 🔥 Allow cache is on).

Manage connected devices

Press ⌘↩︎ on a device to remove it. You can also remove all devices (including this Mac, which logs you out) or the other devices. Bulk actions need a typed yes.

devices

Logout

Logs the CLI out (this Mac is revoked from your devices) and erases the local data, favicons included. Confirm by typing yes.

confirm_delete

🆕 Alfred 6

The workflow runs unchanged on Alfred 5 and uses these Alfred 6 features when available:

  • strictmods: a modifier combination the workflow doesn't define (e.g. ⌘⇧↩︎) does nothing instead of running the default action, so an unexpected shortcut never copies a password.
  • iconresize: fit: favicons keep their proportions.
  • Notifications go through the UserNotifications API.

The new Alfred UI toolkit isn't used for the master password on purpose: a passwordfield can only reach a script through its arguments or an environment variable, both readable by other programs running as you. The macOS dialog used here hands it over through a pipe.

🔐 Security

  • The master password, the browser token and the codes are typed in native macOS dialogs (hidden for the password) and sent to dcli through its terminal. They never go through Alfred's bar, a command line or an environment variable.
  • Passwords and OTP codes are read one at a time with dcli read when you action an item, and never written to disk.
  • The optional list cache holds no secret, is readable by you only (0600) and only exists while the CLI is unlocked, when any program running as you could ask the CLI for the whole vault anyway.
  • Copied secrets are marked transient (ignored by clipboard history managers) and erased after the chosen delay, only if the clipboard still holds them.
  • ⇧⏎ sends its AppleScript through stdin with escaped strings: the password never appears in a process list and can't inject AppleScript.
  • Only http(s) URLs are opened.
  • Bundled libraries are pure Python (pexpect, ptyprocess, certifi): no binary, nothing downloaded at runtime.

🧪 Development

python3 -m unittest discover -s tests

The tests drive the workflow against tests/fake_dcli.py, a stand-in that asks the same questions as the real CLI through a real pty. update.sh refreshes the bundled libraries.

⚖️ License

MIT License © Benjamin Oddou

Latest release

  • 1.7.212 days ago, 430 KBDownload

    No more result line in the list

    • Until now, the result of an action could also appear as an "info" line at the top of the list. This line is removed. Results only go to the native notification (Alfred's Post Notification object).
    • The dl_status / dl_status_icon variables are gone. A test passes the old variables to the Script Filter and checks that they are ignored.
    • With 🔔 Notifications off, actions are silent. The list still shows its states (locked, logged out, …), which are items to act on, not results.

    Notification sound, like Alfred Plex

    • New 🎷 Notification sound setting, with the same choices and labels as Alfred Plex:
      • Mute;
      • Submarine (default), Pop, Ping, Purr, Hero, Funk, Basso, Sosumi, Glass, Blow, Bottle, Frog, Tink, Morse.
    • The sound plays with each notification (copies, sync, lock, errors…).
    • How it plays: /usr/bin/afplay /System/Library/Sounds/<name>.aiff, the same approach as Alfred Plex. It is detached, so it never delays the action or the copy.
    • Only names from the list are accepted, and the file must exist. An empty value means mute. A path or any other value plays nothing.

    Other

    • Version 1.7.2, README and the plist readme updated.
19 earlier releases
  • 1.7.112 days ago, 430 KBDownload

    Native notifications

    • Results are posted by Alfred's own Post Notification object. Alfred 6 delivers these through Apple's UserNotifications API. No helper script is bundled: notificator stays removed.
    • Wiring: Run Script → Conditional ({var:dl_notify_title} not empty) → Post Notification. The notification's title and text are {var:dl_notify_title} / {var:dl_notify_text}. They never use {query}, because the query can hold the copied password. A test checks this in info.plist.
    • What gets notified:
      • copies name the item and say when the clipboard will be cleared: 📋 Password copied · GitHub · cleared in 30 s;
      • OTP copies add the code's expiry: GitHub · expires in 17 s · cleared in 30 s;
      • login, unlock, sync, device removal and errors notify and show the list again;
      • lock, logout, clear cache and favicons only notify. Favicons now say how many icons will be downloaded, or that they are already up to date.
    • New 🔔 Notifications option, on by default. When it is off, every action shows the list again with the result on the first line, like 1.7.0.

    Menu order (fix)

    • With 1.7.0, items could still appear above Sync, Lock… even after reinstalling the workflow.
    • Per the Script Filter JSON docs, "skipknowledge prevents the creation of new knowledge but does not ignore what Alfred already learned". Knowledge is stored per Script Filter object, so a reinstall keeps it.
    • Items now carry no uid. Without a uid, Alfred has no knowledge to sort them with, including what earlier versions taught it. skipknowledge stays to stop new learning. A test checks that no view emits a uid.

    Alfred 6

    Facts below come from the Alfred changelog and the Script Filter JSON docs. The workflow still runs on Alfred 5, which ignores these keys.

    • strictmods: true: a modifier combination the workflow doesn't define (e.g. ⌘⇧↩︎) does nothing, instead of running the default action. An unexpected shortcut can't copy a password any more.
    • iconresize: "fit": favicons keep their proportions. The Alfred 6 default for Script Filters stays stretch for backward compatibility.
    • Every modifier already has a subtitle. Alfred 6 no longer shows a default modifier subtext when it is missing, so nothing changes here.
    • Not adopted: the Alfred UI toolkit for the master password. Per the Alfred UI actions docs, a passwordfield value reaches a script only through args (argv) or a scriptenv variable (environment). Both are readable by other processes running as the user. The hidden macOS dialog used today hands the password to dcli through a pipe and a pty. The docs also only show Alfred UI started from a Keyword or Hotkey, not in the middle of a flow. The README explains this choice.

    Other

    • Version 1.7.1, README and the plist readme updated. The Alfred graph layout from the 1.7.0 release (junction) is kept; only the notification branch is added.
  • 1.7.012 days ago, 429 KBDownload

    Summary

    Keeps the Dashlane CLI (dcli) as the engine. The Python code is rewritten to follow the current dcli login flow, run faster and handle secrets more safely. Notifications are gone.

    Updated for the current dcli

    • New login flow: dcli prints the cli-device-registration page, then asks for the browser token, the email / 2FA code and the master password. The workflow opens the page, then asks each value in a native macOS dialog. The master password dialog is hidden.
    • dcli runs in a pty (pexpect). Prompts are matched on stable fragments, and the answered prompts that inquirer redraws are ignored.
    • dcli errors (error: …, JSON server errors included) are turned into readable messages.
    • OTP works for both otpSecret and otpUrl items.
    • dcli is found in PATH, /opt/homebrew/bin, /usr/local/bin, ~/.local/bin or ~/bin. A new 🛠️ dcli path option covers other locations.

    Performance

    • One dcli call per listing (the old code called dcli password -o json twice).
    • Optional list cache (🔥 Allow cache):
      • served instantly while dcli is unlocked and refreshed in the background;
      • the lock check is a keychain lookup of dcli's own item, attributes only, so no dcli process is started;
      • with 1500 items the cached list takes about 100 ms end to end.
    • New Clear cache item (main and locked views): deletes the cached list and the favicons. The list is rebuilt from dcli on the next search.
    • Favicons download in the background, 8 in parallel, with urllib. Existing icons are skipped.
    • requests, urllib3, idna and charset_normalizer are removed. pexpect is only imported when dcli actually runs.
    • 8 scripts are merged into src/dl.py plus src/dlw/{dcli,ui}.py. The Alfred graph goes from 32 objects to 11.

    Security

    • Master password, token and codes are sent to dcli through its pty. Before, the master password was typed in clear in Alfred's bar and passed in an environment variable.
    • Passwords and OTP codes are read one at a time with dcli read and never written to disk.
    • The cache never holds secrets. It is 0600 and exists only while dcli is unlocked (umask 077 everywhere).
    • The cache is deleted as soon as the vault locks, including when you lock from the terminal. The v1 plaintext JSON files are removed.
    • Copies to the clipboard are marked transient and cleared after 🧹 Clear clipboard (default 30 s), only if the clipboard still holds the secret.
    • ⇧⏎ (type credentials) sends the AppleScript on stdin with escaped strings. Before, the password was in osascript's argv, and a " could inject AppleScript.
    • Only http(s) URLs are opened (javascript: / file: are refused).
    • The notificator os.system shell injection is gone together with notificator.
    • Bundled libraries are pure Python (pexpect, ptyprocess, certifi): no binary, nothing downloaded at runtime (Alfred Gallery rules). A test enforces this.

    No more notifications

    • src/notificator and the 🎷 Notification sound option are removed.
    • After an action (sync, lock, unlock, login, logout, device removal, clear cache, errors), the list is shown again with the result on the first line.
    • These variables are named dl_status / dl_status_icon. Alfred runs scripts with zsh, where status is a special parameter: the first version of this PR showed "0" in the list.
  • 1.6.02 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • New lock option
    • Fix authentication prompt bug, see #5
    • Fix mail otp request
  • 1.5.12 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Update embedded packages
    • Update docs
  • 1.5.03 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Inject credentials in the frontmost app
    • Return expire time when retrieving an OTP
    • Bump dcli to v1.14.2
  • 1.4.23 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Use of dcli read for faster response time
    • Bump Dashlane CLI version to 1.12.0
  • 1.4.13 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Bump Dashlane CLI version to 1.11.0
  • 1.4.03 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • New Action : Manage connected devices. You can remove them easily through Alfred
    • Bump Dashlane CLI version to 1.9.0
    • Fix notification bug when syncing account
    • Update documentation

    Breaking

    ⚠️ The workflow requires dcli v1.9.0 or above

  • 1.3.63 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Bump Dashlane CLI version to 1.8.0.
  • 1.3.53 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Add support for various url format
    • Update packages
  • 1.3.43 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • New fallback icons for password and otp elements
  • 1.3.33 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Modify action icons
    • Refactor user configuration panel
  • 1.3.23 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Improve notification cleaning method 🩹
  • 1.3.13 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Fix notification bug 🩹
  • 1.3.03 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Faster response time with cache enabled 🔥
    • Fix some minor bugs 🩹
    • bump dashlane-cli to v1.7.0 📦
    • Update docs 📖
  • 1.2.03 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Better security. The workflow doesn't expose sensible data to the UI anymore 🛡️
    • Better error handling 🚨
    • Update docs 📖
  • 1.1.03 years ago, 1.2 MBDownload

    Alfred Dashlane Workflow

    • Bump dashlane-cli to v1.6.0 🚀
    • Install dashlane-cli with brew (compatibility with apple silicon) 🦾
    • Faster response time (use native alfred filter results) 🏎️
    • Update docs 📖
    • Remove tldextract -> native python urllib.parse 🪶
  • 1.0.63 years ago, 1.7 MBDownload

    Alfred Dashlane Workflow✨

    • Usage of notificator module created by Vítor Galvão - repo 🚀
  • 1.0.53 years ago, 2.5 MBDownload

    Alfred Dashlane Workflow✨

    • ? icon display when no letter [a-zA-Z] is detected in the title 🩹
    • Some code optimization 💅